phpmyadmin

Richard Korts
Richard Korts used Ask the Experts™
on
I have an existing table in a database that has about 35 columns. I want to build another (empty) table with the EXACT same structure (no rows populated).

Is there a way to do this in phpmyadmin?

My thought is to export the structure only, edit the exported .sql file to change the name & import it.

Is there an easier way?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Marco GasiFreelancer
Top Expert 2010

Commented:
I would  click on Export tab, uncheck Data checkbox and click Execute button: that's all
Marco GasiFreelancer
Top Expert 2010

Commented:
Oh, yes: then you can copy and past the code, edit it as you need to change the table name, save it on your hard drive and then reimport it through Import tab of PhpMyAdmin. You can also past the edited code in SQL tab and click execute.
Cheers
Most Valuable Expert 2011
Top Expert 2016
Commented:
I think the action you want is something along the lines of CREATE TABLE LIKE myTable.
http://forums.mysql.com/read.php?97,23324,26293
http://dev.mysql.com/doc/refman/5.1/en/create-table.html
Richard KortsBusiness Owner / Chief Developer

Author

Commented:
Perfect!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial