Question
How to change default MySQL folder to another one?
Answer
Note: Custom data directory location for client’s MySQL has been supported since Plesk 17.8 MU #41
To change database location follow next steps:
-
Shut down MySQL service through Control Panel > Administrative Tools > Services > right-click MySQL57 > Stop.
Note: if MysQL 5.6 is used, stop
MySQL Server
service instead. -
Copy
"%plesk_dir%"DatabasesMySQLdata
to the new location (e.g. D:MySQLdata). -
Edit “datadir” option in the
C:"%plesk_dir%"PleskDatabasesMySQLmy.ini
file in the following way:[MySQLD]
port=3306
...
datadir=D:MySQLData
... -
Give “Full control” permission to the “NT SERVICEMySQL57” group: right-click the destination folder > Properties > Security.
Note: if MysQL 5.6 is used, Give “Full control” permission to the “NT SERVICEMySQL56” group instead.
8.3. In the opened Windows registry navigate to HKEY_LOCAL_MACHINESOFTWAREWow6432NodePLESKPSA ConfigConfig and find the
MYSQL_DATA_D
string which contains the actual database directory: