Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners How to change default MySQL port in linux?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
How to change default MySQL port in linux?
2 Answer(s)      9 months ago
Posted in : Java Beginners


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?

Thanks


Advertisement
View Answers

December 4, 2013 at 5:20 PM


Hi,

Here are the steps of change the MySQL's default port on Linux based computer.

Step 1:

Loin to your Linux computer as root.

Step 2:

Using vi editor tool open the my.cnf file for editing. Here is the command:

vi /etc/my.cnf

Find the entry:

port       = 3306

Step 3:

Change it to desired port

port       = 3307

or something else.

Save the file and exit the vi editor.

Step 4:

Restart the mysql server using following command:

service mysql restart

After restarting the MySQL server it will start listening on another port.

Thanks



December 4, 2013 at 5:21 PM


Hi,

Check the tutorial MySQL default port number and how to change it if you are using windows machine.

Thanks



Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com