How to copy a table structure and data
To copy table structure run this query
CREATE TABLE database_name.`new_table_name` LIKE database_name.`old_table_name` ;
To copy table data run this query
INSERT INTO database_name.`new_table_name` SELECT * FROM database_name.`old_table_name` ;
Hello! interesting site! I’m really like it! Very, very good!
Thanks a ton for taking a few minutes to line this all out for people. This write-up ended up being quite helpful if you ask me.
Wow, this really helped me, I was looking on Stackoverflow, all the answers were rude and they did not work.
While this works perfectly fine for structure and data, I am wondering if there would be a way to copy triggers along, too.
Do you see a chance?
Thanks you this query is perfectly working.