View Full Version : Backing up MySQL question...
WildWayz
Sun 11th Feb '01, 12:52pm
Lo all
I have quite a few client databases on my server, and because the server is going to be reformatted and RedHat 6.2 is installed, I wanted to back up their data.
Would it be possible to backup the /usr/local/mysql/data folder and all it's contents, then copy it back in when done?
Otherwise I have to go through and do
mysql -u<username> -p<password> <databasename> < <filename>
I tried it on my Win2K home PC, and it was fine - just wondering if it was the same as Linux on that score.
--James
jpetrovs
Sun 11th Feb '01, 1:54pm
If you want to restore all databases exactly as they were on the old server I would use this.
mysqldump -u username -ppassword -A > dumpfile.sql
That will dump ALL databases into one file. I have this setup as a cronjob on my servers to run daily and it works great.
version2
Sat 17th Feb '01, 1:21am
Newbie to MySQL. I am still unsure on how to backup the database. Note: I am not the server admin..however we do have control over most things.
Hostrocket.com
WildWayz
Sat 17th Feb '01, 1:32am
hi ya
to back up your database do this...
telnet into your server
type...
mysqldump -u[username] -p[password] [databasename] > filename.sql
James
version2
Sat 17th Feb '01, 1:43am
Can this be done also from phpmyadmin or whatever its called. Sorry, been up wayyyy too long. I am having some problems server side through telnet.
WildWayz
Sat 17th Feb '01, 1:51am
yes it sure can! :)
just click on urrrm...
Tables and Data
Send
then GO
I think
James
version2
Sat 17th Feb '01, 8:01am
Originally posted by WildWayz
yes it sure can! :)
just click on urrrm...
Tables and Data
Send
then GO
I think
James
This was for backing up before upgrading to 2.0
heh..it was all for nothing anyway...the upgrade script has a backup feature that drops the database.
And that wasnt needed either since the install too about 25 seconds with no problems (knock on wood.)
Mitrofan
Sat 17th Feb '01, 9:02pm
Originally posted by jpetrovs
If you want to restore all databases exactly as they were on the old server I would use this.
mysqldump -u username -ppassword -A > dumpfile.sql
That will dump ALL databases into one file. I have this setup as a cronjob on my servers to run daily and it works great.
Do you actually put this line in the cron job or do you have a script with this line and just start the script with the cron job?
I need to know how to backup a database using cron. When you do mysqldump and use the same name for the dumpfile, does it just overrites the old file?
Chris Schreiber
Tue 20th Feb '01, 12:58pm
I have a MySQL backup script I run from cron right here: http://www.vbulletin.com/forum/showthread.php?s=&threadid=4256
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.