Andrew Beaton :: FAQ

Backup a MySQL database

by Andrew on Nov.27, 2009, under Linux, MySQL, SQL

I’ll just quickly cover some options here to backup a MySQL database.

The first will output all the data and all the databases along with the schema:

mysqldump -u <user> -p -h <hostname> --all-databases > all_databases.sql

The next option will output just the schema for all of the databases:

mysqldump -d -u <user> -p -h <hostname> --all-databases > all_databases.sql

Now we can use the same two methods above but replace –all-databases with the name of a database to output just one.

:, ,
No comments for this entry yet...

Leave a Reply

Powered by WP Hashcash

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

 

Archives

All entries, chronologically...