Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.