group image
Tech Gyan
A shoppezine by JavaGuru
17
 
Posts

 

How to create dump of MySQL database tables

 
Home> Blogs> Tech Gyan> How to create dump of MySQL database tables
 

Using mysqldump command you can create dump of a complete MySQL database or a specific set of tables.

Dump of whole MySQL database

mysqldump --add-drop-table -h HOSTNAME -u root -p DATABASENAME > backup.sql

Example: mysqldump --add-drop-table -h techgayan -u root -p dbtg > backup.sql

This will prompt you for the root password and  create a backup.sql file with your database.

add-drop-table option tells mysqldump to create drop for every create statement in the backup file.

Dump of some MySQL database tables

mysqldump --add-drop-table -h HOSTNAME -u root -p DATABASENAME TABLE1 TABLE2 > backup.sql

Example: mysqldump --add-drop-table -h techgayan -u root -p dbtg tbl1 tbl2> backup.sql

 
By: Java  1899 days ago
 
 
 
 
 

Latest Blog Posts

  
 
 
 
 
Be the first one to comment on this post
 
 

Your Reply

 
 
  
 
 
 

Blog Fans

 
 

Photos

No photo uploaded for this blog.
 
 

Featured Blogs