I am new to MySQL and I am in need of the script which is taking backup of multiple tables from the multiple databases in single file in MySQL?
1 Answer
To dump only specific tables from a database, name them on the command line following the database name:
mysqldump my_database table1 table3 table5 > dump.sql
To dump only specific tables from multiple database, use mysqldump again, but append to the end of the previously created file:
mysqldump my_database2 table1 table3 table5 >> dump.sql
Note the >>
sign
Reference:
https://dev.mysql.com/doc/refman/5.7/en/mysqldump-sql-format.html https://stackoverflow.com/questions/8228116/mysqldump-tables-from-different-databases
-
Thanks for the response Vladimir and is there any script to automate this thing– AzhagiriMar 19, 2016 at 10:31
-
you should try atleast first . No one can give you ready and cooked food to eat. We can give you items to cook Jun 23, 2017 at 10:12