MySQL default port number and how to change it

Here is the default MySQL port number. It is very simple to change the default MySQL port number.

MySQL default port number and how to change it

What is default port number of MySQL Database server?

This tutorial will explain you about the default port number used by the MySQL Server. This information is very important for you if you are working with MySQL Database server. This information will be useful if you have a requirement of connecting to MySQL database server by providing the port number in your program.

You can also change the port number of MySQL database server. Make sure your MySQL server is stopped. You should find the directory of MySQL installation and find the my.ini file. You can then edit the port number and change the value to desired number, finally save the file.

Here is the video tutorial of: "What is default port number of MySQL server and how to change it?"

The MySQL default port number 3306.

Here are the steps to change the MySQL port number.

To change it follow the steps:

  1. Open "my.ini" file in MySQL server installation directory
  2. You will see the default port number "port=3306"
  3. Change it to desired port number.
  4. After changing, save the "my.ini" file
  5. Restart MySQL server

After restart MySQL will start listening to another port. If you have two instance of MySQL Server on the same machine then you can change the port number and run both the instance on the same machine.

Here more tutorials of MySQL: