5

I went to this location C:\ProgramData\MySQL\MySQL Server 5.6 to find my.ini, then I modified the datadir to: datadir=C:/ProgramData/MySQL/MySQL Server 5.6/Dataz

I only added the letter z to the original path, then I created the dataz folder in the MySQL Server 5.6 directory.

then i closed and opened mysql to restart it

I haven't been able to make it work. What am i missing?

2 hours later...

I wasn't restarting mysql server properly, I was only clicking the mysql command client close button. someone told that I had to restart the computer for the changes to take effect, if didn't know how to restart mysql server properly.

After doing this the dataz folder had new files. this is new because I wasn't be able to create this files before They appeared after I restart the computer.

Now, MySQL command client shows an error and closes itself after I enter my password. I can't see the error because the error is shown for one second or less

Erick Leddel
  • 61
  • 1
  • 1
  • 4
  • possible duplicate of [How to change MySQL data directory?](http://stackoverflow.com/questions/1795176/how-to-change-mysql-data-directory) – Sal00m Oct 30 '14 at 08:25
  • Did you copy the whole data into new dataz directory? Sorry for the my stupid question, but actually what you did is right – Gianluca Colombo Oct 30 '14 at 08:27
  • @GianlucaColombo, your questions is not stupid, It's interesting. What do you mean by copying the whole data into new dataz directory? I haven't copied anything. What data do I need to copy? – Erick Leddel Oct 30 '14 at 16:20

3 Answers3

8

If you change the data directory, you have to copy or move all the data inside, to the new directory! The database file includes also all the mysql configuration so, the reason why your MySql doesn't start is because It doesn't find the MySql configuration schema..

Hope my English is clear

Gianluca Colombo
  • 717
  • 17
  • 38
1

You may need to check the login accont of the service MySQL57, if the account is Network Service, you may need to add this account security permission to the parent folder of the new mysql data folder

Phoeson
  • 191
  • 1
  • 6
  • Similarly, what helped me was making the MySQL service start under the service account with access to the new location. Same idea. Thanks for the solution. – Flat Cat Feb 15 '18 at 20:13
0

In my case, I've given the folder permission to read, modify for Users account. Then it worked.

Darkhan ZD
  • 580
  • 8
  • 14