Unable to restart mysql after changing the datadir

Suhail Gupta picture Suhail Gupta · Jan 19, 2016 · Viewed 7.5k times · Source

I am unable to restart the server after changing the default datadir from C:/ProgramData/MySQL/MySQL Server 5.7\Data to D:/Data.

  • I changed datadir to datadir="D:/Data"
  • Then I stopped mysql
  • Copied the Data directory to D:/
  • Attempted to restart the server
  • Unable to start

What could be the reason for it?

Error snapshot:

enter image description here

However, it works fine if the original datadir path is restored.

Answer

sski picture sski · Apr 15, 2016

Assign full permissions to the NETWORK SERVICE for D:/Data