Back Up MySQL Databases From The Command Line

mysqldump command in mysql helps to create textfile dumps of databases. here is few commands to do in commandline
Single Database backup:

mysqldump –u[user name] –p[password]  database_name > database_name.sql

Multiple Database backup:

mysqldump –u[user name] –p[password]  database_one database_two > dumpdatabases.sql

All Database backup:

mysqldump –u[user name] –p[password] -all-databases > all_databases.sql

Restoring from Database backup:

mysql –u[user name] –p[password] database_name < database_name.sql

To restore a single database from dump of all the database

mysql –u[user name] –p[password] -one-database database_name < all_databases.sql

About the author

Janaki( - A Software developer with 9+ years of experience in multiple technology projects across web, mobile, and cloud applications with expertise in PHP, C#, MySQL, Web services and open source platforms.

Similar Posts

Uninstall MySql on a Mac OS X
Creating new mysql user using query

Leave a reply


Eye Test: * Time limit is exhausted. Please reload CAPTCHA.