Skip to main content

How to export a single table from MySQL

Posted on April 7, 2022


How to export a single table

To export a single table run:

mysqldump [options] [database_name] [table_name] > [result_file]

For example:

mysqldump -u drupal -p drupal queue > queue.sql

 

How to import a single table

To import a table run:

 mysql [options] [database_name] < [path_to_import_file]

For example:

mysql -u drupal -p drupal < queue.sql