Monday, June 10, 2019

Move MySQL datadir in Windows

These are the steps I've used to store the MySQL Data folder at a non default location.
  1. Stop the MySQL service
  2. Update my.ini with new datadir that points to the new directory, eg. datadir=D:/Data.
    (To locate my.ini, go to Services, look for MySQL80, right click Properties, and look under Path to executable)
  3. Copy over the existing Data folder to the new directory
  4. Update the Security of the new directory to be the same as the existing directory.
    (Hint: Add NETWORK SERVICE with Full control)
  5. Start the MySQL service

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.