I am using this command to export all database.
mysqldump -u root -p --all-databases > alldb.sql
But it export all tables including MyISAM, However I want to only export and import innodb tables of all databases.
I am using this command to export all database.
mysqldump -u root -p --all-databases > alldb.sql
But it export all tables including MyISAM, However I want to only export and import innodb tables of all databases.
You have to be careful exporting and importing data from InnoDB tables. InnoDB tables "might" contain foreign keys (child and parent table). If the script executed the child table first, then there's a possibility MySQL might produce an error because the Parent table has not exist yet. You can do well MyISAM since they are not strict, doesn't care about foreign keys.
You can follow the below steps
use mysql;
show table status name where engine='innodb';
and do a rectangular copy/paste from the Name column:
+-----------+--------+---------+------------+-
| Name | Engine | Version | Row_format |
+-----------+--------+---------+------------+-
| db1 | InnoDB | 10 | Compact |
| db2 | InnoDB | 10 | Compact |
| db3 | InnoDB | 10 | Compact | |
+-----------+--------+---------+------------+-
to a text editor and convert it to a command
mysqldump -u username --databases db1 db2 db3 > DUMP.sql