Reference: MySQL change data file directory and My.ini location.
1. Find the My.ini location, and you can get the My.ini path by viewing the executable file path, which corresponds to its properties, through the MySQL startup entry for the Windows service.
"D:\MySQL\MySQL Server 5.5\bin\mysqld"--defaults-file= "D:\MySQL Data\my.ini" MySQL55
2, edit the corresponding datadir in My.ini
Before change: datadir= "D:\MySQL data\data\"
After the change: datadir= "D:\MySQL data\mysql Server 5.5\data\" (modified directory may be due to the new directory without permissions and a 1067 error, set the new directory permissions to start normally)
3. Reorganize MySQL data file directory (if not, MySQL will not start properly)
4. Look up the registry and modify the Defaults-file path associated with the MySQL startup entry:
Key_local_machine/system/services/mysql55
When you are finished, refresh the Windows service and look at the executable path, the MySQL startup item properties, again, with the following results:
"D:\MySQL\MySQL server 5.5\bin\mysqld"--defaults-file= "D:\MySQL data\mysql server 5.5\my.ini" MySQL
Be sure to port the My.ini to the correct directory.
5. Restart MySQL, the configuration is successful.
Change the MySQL data data file directory and My.ini location (1067 error occurred)