This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19909|Reply: 3

[Source] Practical Combat MySQL Database Migration Token in Windows

[Copy link]
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 MySql
Next:EF implements bulk database inserts, updates, and deletes
Posted on 12/3/2018 4:56:15 PM |
Unable to restart, what is the solution?
 Landlord| Posted on 12/3/2018 5:00:04 PM |
LeonChen posted on 2018-12-3 16:56
Unable to restart, what is the solution?

Go to Windows Logs to see what error is causing startup failure
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com