gpt4 book ai didi

MySQL外键数据类型错误

转载 作者:行者123 更新时间:2023-11-29 23:30:21 25 4
gpt4 key购买 nike

我在 MySQL 上不断收到错误消息,要求我检查数据类型。

我正在尝试在子表和父表之间创建 fkey userid。

我已确保我的数据类型如下:

父表

enter image description here

子表

enter image description here

最佳答案

在子表中,没有提及 userid 列的属性值,因此默认情况下它将被视为“SIGHNED”,并且父表的主键的默认属性值为“UNSIGHNED”。

根据MySQL手册,整数类型的符号必须相同。

请查看http://dev.mysql.com/doc/refman/5.1/en/create-table-foreign-keys.html

关于MySQL外键数据类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26636112/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com