How to the step 10, “Move the MySQL data directory to the RAID-5 volume you just created”, which means using the My SQL Workbench move the data to the windows server 2012?
MySQL Workbench is the DMBS you will be using to interact with the MySQL server. It was installed with MySQL server. You can open it like any application.
I used to the following source that Professor Wasson linked as well but I was initially confused. However, the instructions is two fold.
1) You need to move the Program Data of MySQL to the new drive. You can do this using the move to function within windows explorer.
2) You need to make a change in the my.ini txt file. You can find this in the Program FIle of MySQL. Look for the part that says datadir in the txt file and change the file location to where you put the data in step 1.
I got an error, ” could not connect. server may not be running, and cannot to MySQL server on 127.0.0.1.
I just copy the file from C: to M:
and I changed the datadir=M:\MySQL\MySQL Server 5.7\Data or datadir=M:\MySQL\MySQL Server 5.7\Data\my.ini
Both of them did not works.
How do I complete Step 9) Update the MySQL57 service so that it runs under the “Local System account” and start the service. Provide a screenshot of the services module showing the MySQL57 service:
mysql
How exactly do I start the service? Based on the MySQL notifier it shows that MySQL57 is running. Everything else I click on the notifier opens up Work Bench.
Anybody else have any issues with moving the datadir? When I pointed it to location other than default one, my MySQL service stopped running, and would not restart. Any advice?
Can you confirm what steps you took to move the Data Directory? Moving the directory consists of a few parts. The first step consists of actually moving the Data folder for mysql and then changing where mysql looks for the data directory within you config folder. Another hint would be stop stop the service when making these changes.
Pat: I stop the service, copy the datadir folder, move it over to the new drive, rename it Eves_Data, and point to it via Workbench. The when I go to start the service, I receive the following error message:
“The MySQL57 service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.”
That error typically occurs when a service tries to start and for some reason it is prevented from starting. This can be due to permissions on the folder, incorrect parameter for datadir, or possibly an error in the my.ini file.
If you want to go deeper into this you can start exploring Event Viewer (Under Administrative Tools). Look under Windows Logs->Application. You will see any errors occurring on the server. This is typically the next step in troubleshooting why a service will not start.
Wenlin Zhou says
How to the step 10, “Move the MySQL data directory to the RAID-5 volume you just created”, which means using the My SQL Workbench move the data to the windows server 2012?
Patrick J. Wasson says
Hi Wenlin,
MySQL Workbench is the DMBS you will be using to interact with the MySQL server. It was installed with MySQL server. You can open it like any application.
Here is helpful link about moving the data directory:
http://dba.stackexchange.com/questions/14320/how-can-i-move-a-mysql-database-to-another-drive
Pat
Paul Linkchorst says
Hi Wenlin,
I used to the following source that Professor Wasson linked as well but I was initially confused. However, the instructions is two fold.
1) You need to move the Program Data of MySQL to the new drive. You can do this using the move to function within windows explorer.
2) You need to make a change in the my.ini txt file. You can find this in the Program FIle of MySQL. Look for the part that says datadir in the txt file and change the file location to where you put the data in step 1.
Hope this helps.
Wenlin Zhou says
Thank Paul, I solve this issue.
Patrick J. Wasson says
Paul, thanks for providing guidance to Wenlin, Your guidance was very clear and helpful. Good work.
Wenlin Zhou says
I got an error, ” could not connect. server may not be running, and cannot to MySQL server on 127.0.0.1.
I just copy the file from C: to M:
and I changed the datadir=M:\MySQL\MySQL Server 5.7\Data or datadir=M:\MySQL\MySQL Server 5.7\Data\my.ini
Both of them did not works.
Patrick J. Wasson says
Hi Wenlin,
Be sure that the MySQL Service is running on your server. The error you received looks like it may not be running.
Also, your Data Dir should be set to: M:\MySQL\MySQL Server 5.7\Data
Pat
Yang Li Kang says
How do I complete Step 9) Update the MySQL57 service so that it runs under the “Local System account” and start the service. Provide a screenshot of the services module showing the MySQL57 service:
mysql
How exactly do I start the service? Based on the MySQL notifier it shows that MySQL57 is running. Everything else I click on the notifier opens up Work Bench.
Patrick J. Wasson says
Hi Yang,
Hint: Under Administrative Tools-> Services
You can stop/start services and change the user in which it runs under. You simply need to find the mysql service in the list.
Pat
David Eves says
Anybody else have any issues with moving the datadir? When I pointed it to location other than default one, my MySQL service stopped running, and would not restart. Any advice?
Patrick J. Wasson says
Hi David,
Can you confirm what steps you took to move the Data Directory? Moving the directory consists of a few parts. The first step consists of actually moving the Data folder for mysql and then changing where mysql looks for the data directory within you config folder. Another hint would be stop stop the service when making these changes.
Hope this helps!
Pat
David Eves says
Pat: I stop the service, copy the datadir folder, move it over to the new drive, rename it Eves_Data, and point to it via Workbench. The when I go to start the service, I receive the following error message:
“The MySQL57 service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.”
Patrick J. Wasson says
Hi David,
That error typically occurs when a service tries to start and for some reason it is prevented from starting. This can be due to permissions on the folder, incorrect parameter for datadir, or possibly an error in the my.ini file.
If you want to go deeper into this you can start exploring Event Viewer (Under Administrative Tools). Look under Windows Logs->Application. You will see any errors occurring on the server. This is typically the next step in troubleshooting why a service will not start.
I will go over this tonight as well.
Pat