Change MySQL directory
Posted by: pdavis (---.speed.planet.nl)
Date: July 08, 2010 07:53PM

I would like to change my MySQL directory to C:\Users\Peter\Documents\MySQLdata, but cannot find how to do this. Any suggestions welcome.

Options: ReplyQuote
Re: Change MySQL directory
Posted by: yfastud (Moderator)
Date: July 09, 2010 09:24PM

and why would you want to do that???

to setup backup, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Change MySQL directory
Posted by: pdavis (---.speed.planet.nl)
Date: July 09, 2010 11:17PM

Why? So that everything that needs regular back-up is in my Documents folder (where I already have my www folder,. and I only need one back-up action

Options: ReplyQuote
Re: Change MySQL directory
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: July 10, 2010 12:13AM

You shouldn't really backup MySQL's data directory.

You should look into performing database dumps which is done via a simple command, this can be performed automatically by setting up a Scheduled Task to dump your MySQL databases into a directory of your choice at regular intervals.

Here is some articles on this procedure
[www.devarticles.com]
[articles.techrepublic.com.com]

Note: The path to mysqldump.exe is C:/wamp/bin/mysql/mysql<version>/bin/

Options: ReplyQuote
Re: Change MySQL directory
Posted by: pdavis (---.speed.planet.nl)
Date: July 10, 2010 11:04AM

>You should look into performing database dumps which is done via a simple command

OK; I'll look into this, although I don't really see why one "shouldn't" backup the files. I did that on my old system (but unfortunately failed to document how I relocated my MySQL directory), and never had any problems with restores. I do realise that then one must copy the entire directory, and not pick and choose individual files.

Options: ReplyQuote
Re: Change MySQL directory
Posted by: pdavis (---.speed.planet.nl)
Date: July 10, 2010 11:59AM

Having read in the TechRepublic article that "The easiest approach is to just copy the entire data/ directory to backup media, and archive it so that you can get it back at any time" I have decided to go back to my original intention. I have answered my own question by Grep-ing the whole WAMP directory on my old system (which, of course, I could have done in the first place). It turns out to be very easy, The only thing that needs changing is the line "datadir=C:/Progs/wamp/bin/mysql/mysql5.1.36/data" in the "C:\Progs\wamp\bin\mysql\mysql5.1.36\my.ini" file. Thanks for the feedback anyway.

Options: ReplyQuote
Re: Change MySQL directory
Posted by: yfastud (Moderator)
Date: July 10, 2010 07:50PM

database dumps via command is a proper way; however, if interested in copy/move db folder(s), you should follow my guide here or you will lose your db's

to setup backup, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.