Symptom
Sometimes there is a requirement to change the save location of MySQL, including logs, etc. This could be due to a drive running out of space.
Resolution
- Shut down the MySQL service.
- Move all the files in your current Data directory to the new location (listed in step 3 -
datadir
parameter). - Locate the
my.ini
file (this is found in the mysql installation directory - as shown in the image above). Change thedatadir
parameter value to point to the new location. Save the file. - Start MySQL.
Tip: If the service won't start, make sure that the drive has write permissions enabled for the user. The error looks like this: