Steps to modify the default port number of mysql:
1. Find my in the MYSQL installation directory .ini
2. Open the my.ini file and modify the port.Ctrl F directly, search for port, as shown in the picture
3306 is the default port number of mysql, change it to the port number you want, pay attention to two Modify everything; save and close after modifications are completed.
3. Restart the mysql service
Method to restart the mysql service:
win r start---run---cmd, stop the service: net stop mysql Restart the service: net start mysql
Or manually restart
right-click my computer-->Manage-->Service And Application-->Service-->mysql-->Right click to restart
The above is the detailed content of How to modify the default port number of mysql. For more information, please follow other related articles on the PHP Chinese website!