Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dump only specific tables from MySQL?

Tags:

mysql

If my database has 10 tables and I want to dump only 3 tables. Is it possible with mysqldump command?

like image 293
Harish Kurup Avatar asked Jun 07 '10 05:06

Harish Kurup


People also ask

How do I export a specific table?

Open the MySQL database wizard & select the table you want to export. Right-click on the table name & select the table data export wizard option.

How do I dump multiple tables in MySQL?

To dump multiple tables with multiple where conditions. Then, for second table, use ">>". It will append the previous dump file.

How do I export just one row in MySQL?

If you want to export only certain rows from a MySQL database using mysqldump , you can select the records using the --where option. It dumps only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter.


1 Answers

Usage: mysqldump [OPTIONS] database [tables] 

i.e.

mysqldump -u username -p db_name table1_name table2_name table3_name > dump.sql 
like image 160
Lauri Lehtinen Avatar answered Sep 28 '22 16:09

Lauri Lehtinen