To change the MySQL Server default port no. 3306,follow the given below steps.

1. Check the aviailbe port in system first:
# netstat -tanp |grep xxxx

2. Now open my.cnf file.
In CentOS/ RHEL is /etc/my.cnf
In Ubuntu and Debian path is /etc/mysql/my.cnf

#vi my.cnf
Port = xxxx

3. Restart the mysql service.
In CentOS / RHEL
#service mysqld restart

In Ubuntu / Debain
#service mysql start
Or
#/etc/init.d/mysql restart

Leave a Reply

Your email address will not be published. Required fields are marked *