How to backup MySQL database? - using mysqldump in command line | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

How to backup MySQL database? - using mysqldump in command line

Wednesday

How to take complete backup of mysql database using mysqldump:
                                                        MySQL provide a great command line utility to take backup of your MySQL database and restore it. mysqldump command line utility is available with MySQL installation

Code:
mysqldump –u[user name] –p[password] [database name] > [dump file name]

Example:
mysqldump –uroot –p db_codingcluster > codingcluster.sql

Backup multiple databases in MySQL.
mysqldump –u[user name] –p[password] [database name 1] [database name 2] .. > [dump file name]

Example:
mysqldump –-user root –-p db_first db_second db_third > db_codingcluster.sql

Backup all databases in MySQL.
mysqldump –u[user name] –p[password] –all-databases > [dump file]

Example:
mysqldump –-user root –-p –all-databases > db_codingcluster.sql

How to restoring MySQL database?
 To restore the database from the dump file that you can use the following mysql command.
 mysql -u [username] -password=[password] [database name] < [dump file name]

Example:
mysqldump –uroot –p db_codingcluster < codingcluster.sql


Please share this post if it's useful to you. Thanks!.

0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets