How to dump mysql table structure without data with a SQL query?

前端 未结 5 1648
遥遥无期
遥遥无期 2020-12-23 19:02

I need to export a mysql table, but it has like 5gb of entries, so I only want the structure. I am trying to do it from a simple php doing a sql query, how can I do that?

5条回答
  •  春和景丽
    2020-12-23 19:32

    It is already answered in the link below:
    MySql export schema without data

    Use the command below to take the structure or schema dump.

    mysqldump -u root -p --no-data dbname > schema.sql
    

提交回复
热议问题