Modification method: 1. Use regedit to find the mysql registry and modify the path of the ImagePath value to modify the mysql executable file path; 2. Modify the datadir value in the "my.ini" file and restart the mysql service. , you can modify the file path of the mysql database.
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
1. How to change the executable file path of MySQL in the service:
1. Open CMD and enter regedit, open Registry Editor
2, find the mysql registry according to the path
Find the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL80,
The service name on my computer is: MySQL80. You can search it according to your actual situation.
Modify the ImagePath value to the correct path.
2. How to change the MYSQL database file path:
Start--Run --services.msc--Find the MySql service and stop the default installation location:
C:\Program Files\MySQL\MySQL Server 5.0 Then, modify the my.ini file.
Enter the MySQL installation directory, find my.ini, and modify the value of datadir.
datadir="D:/Program Files/MySQL/MySQL Server 5.0/Data/" -- Just modify this value
Finally, start the MySQL service.
Start--Run--services.msc--Find the MySql service and start it
Recommended learning: mysql video tutorial
The above is the detailed content of How to modify the mysql service path. For more information, please follow other related articles on the PHP Chinese website!