Tech Help - Moving MySQL Database

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
MikeGracia
A semi-regular
A semi-regular
Posts: 22
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Apr 14, 2013 2:11 pm

Tech Help - Moving MySQL Database

Post by MikeGracia »

Hi guys!

Okay, I'm going to take out an SSD for my DayZ Epoch database.

I'm struggling to sort out how to move it!

Support suggested I posted on these forums, as they said to:

1. Shut down the MySQL server.
2. Change the datadir variable in the MySQL configuration. Make sure to edit this in both the [mysqld] and [mysqld_safe] sections.
3. Change the basedir variable in the same sections.
4. Move the current data folder to the new location you specified.
5. Restart your MySQL server.

The only problem is that the variables datadir (in 2 sections) and basedir (in both sections) are NOT present in the my.ini file (which is where support thought they should be).

JUST TO BE SURE I am checking the correct my.ini file, in my server restart batch file I use:

--defaults-file=server_setup\xampp\mysql\bin\my.ini

So I have navigated to that my.ini file, and that's the one I'm checking... Could there be another? A basic Windows one or something?!

Hmmm any advice guys? :P
.=QUACK=.Major.Pain
This is my homepage
This is my homepage
Posts: 1573
Joined: Sun Jun 26, 2011 8:03 am

Re: Tech Help - Moving MySQL Database

Post by .=QUACK=.Major.Pain »

Why not just export the database,
Uninstall the mysql program you use.
Reinstall it on the SSD drive.
Import the database.
Visit gspreviews.com And Rate & Review Your Old & Current GSP's
Find Your GSP Coupons at gspreviews.com/coupons/
User avatar
Spray
Former staff
Former staff
Posts: 630
Joined: Wed Dec 28, 2011 10:41 pm
Location: Oregon

Re: Tech Help - Moving MySQL Database

Post by Spray »

If you don't see the setting located in the applicable section, feel free to add it. For instance:

Code: Select all

[mysqld]
datadir="E:/MySQL/data"
max_connections=60
read_buffer_size=3M
sort_buffer_size=3M
...
You won't need to change the basedir unless you want to move the entire installation. It would probably be best to just move the datadir to the SSD.
Michigan
A semi-regular
A semi-regular
Posts: 16
Joined: Mon Aug 12, 2013 1:17 pm

Re: Tech Help - Moving MySQL Database

Post by Michigan »

.=QUACK=.Major.Pain wrote:Why not just export the database,
Uninstall the mysql program you use.
Reinstall it on the SSD drive.
Import the database.
This, this is what I did for my old gameserver and brought it here.
.=QUACK=.Major.Pain
This is my homepage
This is my homepage
Posts: 1573
Joined: Sun Jun 26, 2011 8:03 am

Re: Tech Help - Moving MySQL Database

Post by .=QUACK=.Major.Pain »

It would be the same if your just moving from hard drive to SSD wouldn't it?
Or are you trying to keep WAMP on the hard drive and just the data on the SSD?
Visit gspreviews.com And Rate & Review Your Old & Current GSP's
Find Your GSP Coupons at gspreviews.com/coupons/
MikeGracia
A semi-regular
A semi-regular
Posts: 22
Joined: Sun Apr 14, 2013 2:11 pm

Re: Tech Help - Moving MySQL Database

Post by MikeGracia »

.=QUACK=.Major.Pain wrote:It would be the same if your just moving from hard drive to SSD wouldn't it?
Or are you trying to keep WAMP on the hard drive and just the data on the SSD?
Open to both options really, just trying to get the database to run on SSD for faster access etc

What would you recommend? Data only on SSD or whole install?
.=QUACK=.Major.Pain
This is my homepage
This is my homepage
Posts: 1573
Joined: Sun Jun 26, 2011 8:03 am

Re: Tech Help - Moving MySQL Database

Post by .=QUACK=.Major.Pain »

I think the easiest way is to fully install it on the SSD.
I wouldn't know enough about separating the program from the database and syncing it all properly.
Visit gspreviews.com And Rate & Review Your Old & Current GSP's
Find Your GSP Coupons at gspreviews.com/coupons/
Post Reply