7

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.

4

2 回答 2

12

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

于 2016-04-15T17:03:26.347 回答
4

Ensure my.ini is ANSI encoded with a tool like Notepad++.

I updated the datadir in my.ini with Windows Notepad and it apparently converted it to UTF-8; I copied the file over to a system with Notepad++, converted it back to ANSI before copying it back to the MySQL server and was able to start the MySQL service successfully.

于 2019-04-11T22:01:20.987 回答