Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change MySQL data directory on windows?

Tags:

mysql

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

like image 314
Erick Leddel Avatar asked Oct 30 '14 08:10

Erick Leddel


People also ask

How do I reconfigure MySQL server in Windows?

To restart the server configuration, open MySQL Installer from the Start menu and click Reconfigure next to the appropriate server in the dashboard. Product configuration. This step applies to MySQL Server, MySQL Router, and samples only. The status for each item in the list should indicate Ready to Configure .


2 Answers

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

like image 169
Gianluca Colombo Avatar answered Oct 17 '22 03:10

Gianluca Colombo


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

like image 22
Kevin Avatar answered Oct 17 '22 04:10

Kevin