Skip to content

Copy existing table schema to a new table

Copy existing table schema to a new table

Answer:

To copy the table schema of an existing table to a new table, without copying its data:

mysql> CREATE TABLE new_table LIKE old_table;

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  1. How to rename table in MySQL
  2. Create temporary table in MySQL
  3. Add an existing user to an existing group
  4. How to REORG a table in MySQL
  5. Repair table in MySQL

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*