I have a mysql database with InnoDB tables that I need to copy into a newly created database. I would like to automate the copying process with a script since there are over 100 tables.
This is my current code. After 10 tables, it's getting tiresome:
> use newdb;
> CREATE TABLE tableA LIKE old_db.tableA
> INSERT INTO tableA SELECT * FROM old_db.tableA
How can I extract the table names from old_db
in order to automate this process?