How to export and restore few tables in mysql database from command line?

How to export some tables from mysql database and import it using command line?

Dump ( mysqldump ) and restore a single table database.

We can export some/partial number of tables from mysql database and below are the commands which you can use and put your details according:

Export:
        sudo mysqldump -h db_hostname -P 3306 -u db_username -p DatabaseName table_1 table_2 > export_tables.sql
Import:
        sudo mysql -u db_username -p DatabaseName < export_tables.sql

In case you are trying to export azure mysql database you may face some error, in that case use below command.

        sudo mysqldump --column-statistics=0 --no-tablespaces -h db_hostname -P 3306 -u db_username -p DatabaseName table_1 table_2 > export_tables.sql