Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a database in MySQL with several tables. Some of the tables only have .frm files. Some have .frm .mdy .mdi I believe data for the .frm tables is in the ibdata file.

There is a lot of data in all the tables and I can see it.

How do I make a duplicate of this database with a different name? I can copy the folder and rename, but the tables with just the .frm files don't have the data.

Is there an easy simple way I can do this?

share|improve this question
up vote 0 down vote accepted

CREATE TABLE student2 SELECT * FROM student

edit: into a new database CREATE TABLE newdatabase.student2 SELECT * FROM olddatabase.student

share|improve this answer
That will do it in the same database, i want to e able to copy the table into a new database – Beginner Oct 7 '11 at 13:07
CREATE TABLE newdatabase.student2 SELECT * FROM olddatabase.student – Miademora Oct 7 '11 at 13:28
Error Code: 1146Table newdatabase.student2 doesnt exist – Beginner Oct 7 '11 at 13:32
Thats the error i get – Beginner Oct 7 '11 at 13:32
i worked out a way around if i create the table and then do an insert into like you shown instead of create it works – Beginner Oct 7 '11 at 13:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.