- Stop the MySQL service.
- Use Windows Administrative Tools > Services
- Move the data files to a new location.
- They are stored in C:\ProgramData\MySQL\MySQL Server 5.7\Data by default.
- You may have to turn on viewing hidden items in Explorer to see C:\ProgramData.
- Make sure NETWORK SERVICE has full NTFS permissions on the new folder.
- Right click the new folder and select Properties.
- Go to the Security tab and click Edit.
- Click Add, type in "network service", and click OK.
- Check the box under Full Control and Allow.
- Change the location in my.ini.
- Edit C:\ProgramData\MySQL\MySQL Server 5.7\my.ini.
- Search for the line that starts with datadir=
- Change the path to the new location and save.
- Restart the MySQL Service.
Friday, March 24, 2017
Changing MySQL's Storage Location
These are instructions for changing the location where MySQL stores its database files. They're for version 5.7.17, but that's the latest version as of this writing and they will probably work with future versions as well.