Reputation: 699
I want to write a set of small shell scripts to help me keep MySQL schema in git. But one crux is that mysqldump -uuser -ppass -d devdb > schema.sql
includes two things that change over time even if there are no schema changes:
AUTO_INCREMENT=[some number]
at the end of the definition of any table that has an auto-incremented column-- Dump completed on [date and time]
at the endI have scoured the web for ways to get a dump without those things, to no avail. Can you advise? Or should I be using a different command or tool to get a clean schema for use in version control?
EDIT: I just now found the --skip-dump-date
option, so that solves point #2, but I still can't get rid of the auto-increment number without losing the other table attributes (or whatever you call those things) like the engine and the default character set.
Upvotes: 1
Views: 168
Reputation: 141
There is no way to bypass #1, check https://bugs.mysql.com/bug.php?id=20786.
As noted in the comments section, you can use that sed command to filter it out (unless you have some CREATE TABLE statements that use it).
Upvotes: 2