I have a sever and due to some reasons I want to run the MySQL server on the different port and not on the detault port 3306.
How to change the MySQL default port on my Linux box?
Here are the steps of change the MySQL's default port on Linux based computer.
Loin to your Linux computer as root.
Using vi editor tool open the my.cnf file for editing. Here is the command:
Find the entry:
port = 3306
Change it to desired port
port = 3307
or something else.
Save the file and exit the vi editor.
Restart the mysql server using following command:
service mysql restart
After restarting the MySQL server it will start listening on another port.
Check the tutorial MySQL default port number and how to change it if you are using windows machine.