0

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?

Jay
  • 741
  • 10
  • 26

1 Answers1

0

Use MySQLWorkbench to export the schema and data from the source database and then import into the new database.

rvillar
  • 76
  • 5