How to export each tables from a database into a separate files using mysqldump command
How to export each tables from a database into separate files using mysqldump command. Create a script file, and put the below content into it.
#!/bin/bash
T_PATH=Downloads/tables_templates
for TB in `mysql -u root -proot -N -B -e 'show tables from drupal'`;
do
echo "Backing up $TB"
mysqldump --add-drop-table --add-locks --complete-insert -u root -proot drupal $TB > $T_PATH/template_$TB.sql
Where T_PATH is location of the file where script will export the table. and TB is a reference to the current value of show tables command.
Comments
Post a Comment
There is comment posted on your blog, chandu7929@blogpost.com