CodingHaving a Dump

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  -Daz-  
 To:  ALL
31665.1 

Hello children.

 

What's the best practice way of backing up a MySQL database regularly?

 

Matt, I'm looking at you!

 

All my love.
Darren.

 


Edit: Spelling Spacks

 

Edit 2: Why is it not showing edits? Does it have to be read first?


Did You Know?
In parts of central and eastern China it is considered impolite to kick a man in the nuts and shag his wife.
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  -Daz-     
31665.2 In reply to 31665.1 
I thought a short grace period was added a while ago - 5 mins or summat.

Bush Says Cheney, Rumsfeld Will Stay: "Both Men Are Doing Fantastic Jobs"...

Associated Press, 1 Nov 2006

0/0
 Reply   Quote More 

 From:  Matt  
 To:  -Daz-     
31665.3 In reply to 31665.1 
From the terminal / command prompt using the mysqldump program, which is provided with MySQL - In Windows you may need to add the \MySQL\bin\ directory to your %path% variable, and redirect the output to a file, i.e.:

code:
mysqldump -uusername -ppassword database > database_dump.sql


You can automate that from a cron job or Task Scheduler.

To import you can use the MySQL command line client:

code:
mysql -uusername -ppassword -Ddatabase < database_dump.sql


(Note the difference in commands when specifying the database to use)

I'm sure you could probably get all clever and append the date and time to the filename and even tar and gzip it or zip/rar if you wanted to.

doohicky

0/0
 Reply   Quote More 

 From:  -Daz-  
 To:  Matt     
31665.4 In reply to 31665.3 
Much obliged Matt. I knew dumping was involved somewhere.

Did You Know?
In parts of central and eastern China it is considered impolite to kick a man in the nuts and shag his wife.
0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  -Daz-     
31665.5 In reply to 31665.4 
if you need to compress it and stick the date in, i have it on a crontab at work somewhere working like that. so shout.
0/0
 Reply   Quote More 

 From:  DSLPete (THE_TGG)  
 To:  Matt     
31665.6 In reply to 31665.3 
may I be so bold as to recommend the --opt switch when doing the dump
0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  DSLPete (THE_TGG)     
31665.7 In reply to 31665.6 
its the default though??
0/0
 Reply   Quote More 

 From:  Matt  
 To:  DSLPete (THE_TGG)     
31665.8 In reply to 31665.6 
What he said ^

doohicky

0/0
 Reply   Quote More 

Reply to All    
 

1–8

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats