Search code examples
mysqlsqlyog

mysql export loses AutoIncrement


When I export a table through SQLYog, the CREATE statement in the exported file lacks AutoIncrement on its primary key, even though the original table contained AutoIncrement.

Is this a bug (in Yog or in mysql?)? Should I report it? How can I export the table with the AutoIncrement in place?


Solution

  • This happened to us also when using mysql from the command line. It turned out this happened because we added "skip opt" flag. The way to resolve is to either drop "skip opt" or add "--create-options" (Thanks Shlomo)

    I just tried to reproduce this via SQLYog, and failed - so the problem must have only been presented in our custom dump scripts.