Linux:mysql:dumps: Difference between revisions

From Marks Wiki
Jump to navigation Jump to search
New page: Read the manual on mysqldump, especially option --opt. Also, check the section "Database backups", under "Solving common problems with MySQL". You can dump the database into a file us...
 
No edit summary
 
Line 4: Line 4:
You can dump the database into a file using:  
You can dump the database into a file using:  
   
   
   mysqldump -h hostname -u user --password=password databasename > filename  
   mysqldump -h hostname -u user --password=password databasename > filename
 
you can restore the info to the database again using:  
you can restore the info to the database again using:  
   
   
   mysql -h hostname -u user --password=password databasename < filename
   mysql -h hostname -u user --password=password databasename < filename

Latest revision as of 08:00, 6 August 2009

Read the manual on mysqldump, especially option --opt. Also, check the section "Database backups", under "Solving common problems with MySQL".

You can dump the database into a file using:

 mysqldump -h hostname -u user --password=password databasename > filename

you can restore the info to the database again using:

 mysql -h hostname -u user --password=password databasename < filename