Question

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?

Was it helpful?

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.

OTHER TIPS

You should report it whether you think it's a bug or not. A cursory browse through online info gives no indication as to whether the loss of auto-incrementing columns is intentional or not.

And, if it's not specified one way or the other, I would be inclined to think that it should re-create the tables exactly as they were. This would be no different than if the export created a create table statement that left off columns starting with the letter X :-)

Raise it as a bug. If this is a genuine, documented restriction of the product, they will tell you, and hopefully point you to the documentation that details this. They'll probably also be able to tell you any workarounds that may fix it. They may state that it's because of some bone-headed decision from the MySQL people in which case you can then hit them with a bug report :-)

If it's actually a bug, good developers will be glad to hear about it so they can improve their product.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top