Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-02-2007, 05:28 AM
yzerfontein yzerfontein is offline
Junior Member
 
Join Date: 04-14-07
Posts: 6
iTrader: 0 / 0%
mySQL backup

How do you backup a mySQL database? I've got access to phpMYadmin.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 05-02-2007, 10:18 AM
NullPointer NullPointer is offline
Contributing Member
 
Join Date: 05-02-07
Location: Irvine, CA
Posts: 55
iTrader: 0 / 0%
You can export your data to a file and then Import it back to the database
 
Reply With Quote
  #3  
Old 05-03-2007, 04:41 PM
StupidScript's Avatar
StupidScript StupidScript is offline
Senior Member
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 663
iTrader: 0 / 0%
As NullPointer said:

In phpMyAdmin:

Select the database you want to backup, choose the "Export" tab, define what syntax you will use for the backup (SQL) and a name for the file that contains the exported data, then hit GO.

From the command line:

mysqldump -u user -pPaSsWd dbname > outputfile
 
Reply With Quote
  #4  
Old 05-03-2007, 09:07 PM
photocrats's Avatar
photocrats photocrats is offline
Contributing Member
 
Join Date: 07-25-05
Posts: 491
iTrader: 2 / 100%
Lightbulb

phpmyadmin is the best way but after exporting the database, always check the file. Sometimes it becomes corrupted file with wired texts.
 
Reply With Quote
  #5  
Old 05-04-2007, 03:34 PM
StupidScript's Avatar
StupidScript StupidScript is offline
Senior Member
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 663
iTrader: 0 / 0%
Quote:
phpmyadmin is the best way
Acknowledging both that there are a few ways to do this and your excellent suggestion to check the resulting file after using phpMyAdmin, I beg to differ with your assessment of which method is 'best'. I've never had a corrupted file (or any restoring issues) using mysqldump, it takes only a second or two to complete, and there's no question about its formatting, as it is drawn from the current installation's configuration and capabilities. IMHO.
 
Reply With Quote
  #6  
Old 05-28-2007, 12:12 AM
alainkun alainkun is offline
Contributing Member
 
Join Date: 05-06-07
Posts: 84
iTrader: 0 / 0%
Yes, you pnly need export DB.
If you need do it every days you can try to do a small PHP file:

<?php
$conexion = mysql_connect('localhost', 'user', 'pass');
$result = mysql_query('SHOW DATABASES', $conexion);
while ($row = mysql_fetch_row($result)) {
echo "Backup of ".$row[0]." ... ";
exec("mysqldump --host=localhost --user=user --password=pass --opt --default-character-set=utf-8 --flush-logs ".$row[0]." | bzip2 -c > /your/root/on/server/to/save/DB".$row[0]."-".date('Y.m.d').".sql.bz2");
echo "finish.n";
}
?>

You can add it to a crownjob on your host to do it automaticly every days
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Backup marc_gfx Dedicated Servers 12 11-29-2007 11:51 PM
wp-db-backup - Can you send it to me? dcristo Blogging Forum 2 07-20-2007 09:02 PM
MySQL backup ref: INSERT INTO Woody Coding Forum 4 08-10-2006 09:03 AM
How often do you backup your database? Pinyo Web Design Lobby 1 08-20-2004 12:01 PM
MYSQL Database Backup Scripts Limit Coding Forum 6 02-25-2004 04:44 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 02:21 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC