How to view and modify the port number of MySQL under Windows

Source: Internet
Author: User
Tags mysql version


Take the Win7 system, MySQL version 5.5.57 as an example:

    • View the port number of the native MySQL (default is 3306)
    1. Open a DOS window

Win+r Open the Run interface input cmd or enter CMD in the Start menu search box and return

2. Connect to MySQL Service

Enter Mysql-u root-p and then enter

3. Continue to enter the password, and then enter:

4. The following interface shows the successful connection to MySQL service

5. Enter the command to view the port number:show global variables like ' port ';

6. For example, 3306 is the port number of the current MySQL service

    • If you want to modify the port number of MySQL, the following actions are required:
    1. Locate the My.ini file in the MySQL installation directory

      

2. Open through the tool, I use notepad++ ctrl+f search for the MySQL port number we found just now, the default is 3306, we have not changed before, so is 3306. It will be found that there are two "port=3306" in lines 53 and 70, both of which need to be changed. Change to the new port number you want to set (the port number range is 0-65535). (I changed it to 3396)

    3. After the My.ini file is changed and saved, we need to restart the MySQL service. Otherwise, the connection cannot be successful.

4. On the desktop, find "My Computer" right click and select "Manage"
5. Find "Services and Applications" and double-click

    

6. Continue to double-click "Services"

    

7. Find "MySQL" in the list and right click to select "Restart"

    

8. Wait for the restart ING

    

After the reboot is complete, check to see if the change was successful, as we have just looked at the MySQL port number.

    

, 3396 is the port number I changed.

    

  

  

  

How to view and modify the port number of MySQL under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.