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
Here is the command to dump the schema without the character set and AUTO_INCREMENT.
mysqldump -h localhost -u root -p --no-data YOUR_DATABASE_HERE |egrep -v "(^SET|^/\*\!)" | sed 's/ AUTO_INCREMENT=[0-9]*\b//'
Here is the command to dump the schema without the character set, AUTO_INCREMENT and the comments
mysqldump -h localhost -u root -p --no-data --compact YOUR_DATABASE_HERE |egrep -v "(^SET|^/\*\!)" | sed 's/ AUTO_INCREMENT=[0-9]*\b//'