How to change default MySQL port in linux?

How to change default MySQL port in linux?

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

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:
How to change default MySQL port in linux?
How to change MySQL default port Windows?
Advertisements
How to change MySQL default port Windows?
MySQL default port number and how to change it
MySQL Default Port number
MySQL default port number in Linux
how to change spring boot port number
Changing MySQL Port Number
What is the default session time in php and how can I change it?
what is redis default port number
mysql port number other than 3306
Change port from 8080 to 80 in Apache tomcat - WebSevices
ModuleNotFoundError: No module named 'linuxU'
ModuleNotFoundError: No module named 'linuxU'
ModuleNotFoundError: No module named 'linuxU'
How to change image size before adding to mysql using jsp
Change Column Name in MySQL
Toedter JDateChooser JSpinner change day value by default in java
Mysql Date Default
Change root password of MYSQL using Java
Mysql Alter Column Default
How to change background, change background
How to change the face, change the face
Mysql Add Column Default Value
how to change color of titlebar in java
How to change functionlatiy in web page
dynamically how to change attiribute values in xml
How to change password mask field?
How to get xml file form http port using web service
How to change the checkbox value dynamically.
How to change object item to integer item
How to change the data in the table dynamically ?
How to change uploaded file root path ?
How to assign a default value to text box in netbeans
How to change color of opened Bootstrap drop down toggle?
how to change file from .txt to .mat(matrix)
how to change password into one jsp to another jsp
Change Local Repository
how to by default chceckbox button is selected in struts
How to configure mvc:default-servlet-handler tag?
How to change the cloth pattern, change the cloth pattern, cloth pattern
how to Change column name and Make a unique column.
How alter table in MySQL?
Getting the Local port
how to add date and change date in java - netbeans
ModuleNotFoundError: No module named 'port'
ModuleNotFoundError: No module named 'port-for'
How to change the color of a base64-encoded png image JQuery?
how to change div background color in javascript
How can I change UIButton title color?

Ads