mysqldump - Export structure only without autoincrement

前端 未结 5 1887
太阳男子
太阳男子 2020-12-04 14:16

I have a MySQL database and I am trying to find a way to export its structure only, without the auto increment values. mysqldump --no-data would almost do the j

5条回答
  •  抹茶落季
    2020-12-04 14:51

    JoDev's answer worked perfectly for me with a small adjustment to the sed regular expression:

    mysqldump -d -h localhost -u -p  | sed 's/ AUTO_INCREMENT=[0-9]*//g' > databaseStructure.sql
    

提交回复
热议问题