How do I use mysqldump to export only the CREATE TABLE commands?

后端 未结 6 1455
情深已故
情深已故 2021-01-31 15:26

I\'m trying to use mysqldump to export only the DB schema -- no data, no additional SQL comments, just the CREATE TABLE commands. Here\'s what I\'ve go

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 16:20

    This uses grep as well, but it seems to work:

    mysqldump -d --compact --compatible=mysql323 ${dbname}|egrep -v "(^SET|^/\*\!)"
    

    I'm using:

    Ver 10.11 Distrib 5.0.51a, for debian-linux-gnu (x86_64)

提交回复
热议问题