如下语句
mysql> alter table todomodel_tasks add foreign key(user,projects) references tod
omodel_projects(user,name);
在tododmoel_projects中 user和name 是一个组合,他们合起来是主键。
不是说外键只要对应其他表里的主键就好了吗。
然而会报下列错误
Cannot add foreign key constraint
问问各位大神们这是咋回事呢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...