I recently upgraded from MySQL 5.0.x to 5.5.x and ran into a weird issue where mysqldump command would also include the auto_increment in the resulting .sql. This isn’t an issue if you are dumping data, but if you are dumping only schema then this is a problem b/c any new entries into the table will start at whatever value the auto_increment value is, not the idea situation. You can read more about the bug @ http://bugs.mysql.com/bug.php?id=20786.

A user with the name Richard Fearn posted a fix for removing auto_increment references from the .sql file:

sed 's/ AUTO_INCREMENT=[0-9]*\b//'

So the full mysqldump cli command would look like:

mysqldump -u root -p -h <db-host> --opt <db-name> -d --single-transaction | sed 's/ AUTO_INCREMENT=[0-9]*\b//' > <filename>.sql

I’ve tried this command and works well.