Mysql 8.0 modified version of the default database directory

After several tests and check online, now a relatively simple process recorded as follows:

A, Mysql 8.0 later installed through Mysql installer, during the installation thereof is omitted.

Second, the installation process and no place to specify the data directory. (8.0.16 is still there, but after that version did not)

General Mysql default installation path is C drive, (of course, this path can be adjusted, but when first installed, if it is added, removed, you can not specify the path), it is necessary to manually adjust the database directory.

Recommended when installing, select the Install Mysql workbench client.

 

Third, after the installation is complete, automatic start Mysql service, and enter the management interface through Mysql Workbench. Options File option to enter the Administration tab,

 

 Looking to see datadir option to modify it to the specified directory, such as: D: \ Mysql \ Data

Close Mysql service. (Next time you start, can not be started)

 

Fourth, the original Data directory (and under File) completely copied to the new database directory.

 

Fifth, the new database to assign permissions to the directory ( this is the most critical step, the main reason for not restart after the previous close is this )

If during the installation, the user is not specified, then the directory to add "NETWORK SERVICE" other authority other than full control.

 

Sixth, restart the service, you can start properly.

 

[Note] profile path generally in C: \ ProgramData \ MySQL \ MySQL Server 8.0 \ my.ini file. You can also modify the path manually, but the key point is that after specifying a new path, you need to copy the files over, and assign permissions.

Guess you like

Origin www.cnblogs.com/wuxs2008/p/12358383.html