How to change the location of database files in MySQL 8.0?
On my comp installed the MySQL server is 8.0. For the database file has been allocated a separate HDD. How to make files of this database lying on a new separate hard drive, and the MySQL server remains on the old disk? Need to on the new drive was the ONLY one with the database files without any garbage.
Ignacio_Romaguera answered on June 5th 19 at 21:14
- gracefully stop the database
- make sure that the base is not running
- copy the entire datadir (see mysql configuration file) to new location
- change datadir in the config to the new location
- start database
- verify and to demolish the old datadir
conor.Hilpert90 answered on June 5th 19 at 21:16
datadir=/data/mysql - write path where you want to go