This handy command line snippets allow us to import and export databases or tables with mysql built in function. Mysqldump command can be configured to export databases, or just a table.
//Export
Database
mysqldump -uUsername -p
Database
> db_backup.sql
//Export Multiple databases
mysqldump -uUsername -p
//Export
All
databases
mysqldump -uUsername -p
//Export a
table
mysqldump -uUsername -p
Database
Tablename > table_backup.sql
//Export multiple tables
mysqldump -uUsername -p
Database
Table1 [Table2 ...] > tables_backup.sql
Restore database or tables from mysqldump file
mysql -u username
No comments:
Post a Comment