mysql creates the same table structure

Foreword:

The sub-table storage is used in the project, and 100 tables need to be created. Each table has the same structure. The original operation is to copy and paste one by one and modify the name. DBA gave advice today

 

create table a like b

Copy the table structure and indexes of b

 create table a as select * from b limit 0

Only the table structure is copied, not the table index

See blog: https://blog.csdn.net/risingsun001/article/details/23449241

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324744422&siteId=291194637