|
|
Posted on 4/10/2018 11:30:34 AM
|
|
|
|

First, Windows 2008 r2 x64-bit system, mysql version 5.7.21, as shown in the figure below:
Stop the MySQL service
In the computer service, find the MySQL service we are running, stop the MySQL service, and record the parameters configured in the "path of the executable file", as shown in the figure below:
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57
Modify the configuration file
C:\ProgramData\MySQL\MySQL Server 5.7\my.ini 文件就是MySQL服务启动的配置文件了,我们找到“datadir”参数,如下:
Default database storage path:C:\ProgramData\MySQL\MySQL Server 5.7\Data
Migrate the new storage path for the database:D:\MySqlDataNew
We modify it to a new path and save:
Database migration
First, we create a new MySqlDataNew folder under the root directory of D drive, and then cut the files under the "C:\ProgramData\MySQL\MySQL Server 5.7\Data" directory to our new directory "D:\MySqlDataNew", as shown in the figure below:
Configure the new directory permissions
If you start the MySQL service at this time, it will fail! This is because our new directory doesn't have the correct permissions set!
Right-click on the newly created MySqlDataNew folder - >Properties-> Security, and add NETWORK SERVICE to Groups and Users (G).
Finally, launch the MySQL service! (End)
|
Previous:MySQL Workbench 6.3 CE does not display databases such as MySqlNext:EF implements bulk database inserts, updates, and deletes
|