mysql导出失去自动增量

发布于 2024-09-29 17:09:10 字数 142 浏览 3 评论 0原文

当我通过 SQLYog 导出表时,导出文件中的 CREATE 语句在其主键上缺少 AutoIncrement,即使原始表包含 AutoIncrement。

这是一个错误(在 Yog 中还是在 mysql 中?)?我应该举报吗? 如何导出带有自动增量的表?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨轻弹 2024-10-06 17:09:10

当我们从命令行使用 mysql 时,这种情况也发生在我们身上。事实证明,这是因为我们添加了“skip opt”标志而发生的。解决方法是删除“skip opt”或添加“--create-options”(感谢 Shlomo)

我只是尝试通过 SQLYog 重现此问题,但失败了 - 所以问题一定只出现在我们的自定义转储脚本中。

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.

长发绾君心 2024-10-06 17:09:10

无论您是否认为这是一个错误,您都应该报告它。粗略浏览一下在线信息并没有表明自动增量列的丢失是否是有意的。

而且,如果没有以某种方式指定,我倾向于认为它应该按原样重新创建表。这与导出创建一个 create table 语句没有什么不同,该语句省略了以字母 X 开头的列:-)

将其作为错误提出。如果这是一个真实的、有记录的产品限制,他们会告诉您,并希望您能找到详细说明这一点的文档。他们可能还会告诉您任何可以解决该问题的解决方法。他们可能会说这是因为 MySQL 人员的一些愚蠢决定,在这种情况下你可以用错误报告来打击他们:-)

如果这实际上是一个错误,优秀的开发人员会很高兴听到它,这样他们就可以改进他们的产品。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文