Import single database from –all-databases dump

You can use the following command: mysql -u root -p –one-database destdbname < alldatabases.sql Where destdbname is your desired database which you want to restore. Another option which is IMHO much safer, is to extract the DB from an –all-databases dump. Example: sed -n ‘/^– Current Database: `dbname`/,/^– Current Database: `/p’ alldatabases.sql > output.sql Replace … Read more

mysqldump – Export structure only without autoincrement

You can do this : mysqldump -u root -p -h <db-host> –opt <db-name> -d –single-transaction | sed ‘s/ AUTO_INCREMENT=[0-9]*\b//’ > <filename>.sql As mentioned by others, If you want sed to works properly, add the g (for global replacement) parameter like this : mysqldump -u root -p -h <db-host> –opt <db-name> -d –single-transaction | sed ‘s/ … Read more

Mysqldump only tables with certain prefix / Mysqldump wildcards?

You can specify table names on the command line one after the other, but without wildcards. mysqldump databasename table1 table2 table3 You can also use –ignore-table if that would be shorter. Another idea is to get the tables into a file with something like mysql -N information_schema -e “select table_name from tables where table_schema=”databasename” and … Read more

mysqldump exports only one table

try this. There are in general three ways to use mysqldump— in order to dump a set of one or more tables, shell> mysqldump [options] db_name [tbl_name …] a set of one or more complete databases shell> mysqldump [options] –databases db_name … or an entire MySQL server—as shown here: shell> mysqldump [options] –all-databases

Export Data from mysql Workbench 6.0

mysqldump: [ERROR] unknown variable ‘delayed-insert=FALSE’ This error occurs on various systems and can be temporarily fixed by: Going to the appropriate directory depending on the system: a) Windows: C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules (32-bit installation on x64 systems: C:\Program Files (x86)\MySQL\MySQL Workbench 6.3 CE\modules) b) Mac OS X: Applications/MYSQLWorkbench.app/Contents/Resources/plugins – right click on the app … Read more

mysqldump & gzip commands to properly create a compressed file of a MySQL database using crontab

First the mysqldump command is executed and the output generated is redirected using the pipe. The pipe is sending the standard output into the gzip command as standard input. Following the filename.gz, is the output redirection operator (>) which is going to continue redirecting the data until the last filename, which is where the data … Read more