I am using MySQL v5.1.

I am developing a **Rails** app. and writing a **ruby** script to copy database. So far, I have got an array of table names, the number of tables is 2090. I need to create all the tables in a new database, my code looks like:

```
#"table_names" is fetched by execute 'show tables' SQL commands

 table_names.each { |tbl_name|
     ActiveRecord::Base.connection.execute("CREATE TABLE #{new_db_name}.#{tbl_name} LIKE #{old_db_name}.#{tbl_name}")

  }

```

This code works, but it took a long time to complete, because the code has to execute the `CREATE TABLE` command one by one and there are 2090 tables to create.

I am wondering is there any way to have **bulk creating** of tables (like **bulk inserting** of data) in SQL to save the time? If not, how can I improve the speed of creating the tables? That's copy all 2090 tables from one database to another.

**P.S.** I don't want to hard code all 2090 table names in SQL file.