mysql建好的table增加外鍵約束
2012-04-26 18:17
99 查看
--usr_info表已經建立完成了usr_info表中有一列role_id需要增加外鍵約束
--usr_info表中有一個外鍵role_id參考表udf_role的role_id主鍵
[/code]
ALTER TABLE usr_info ADD foreign key(ROLE_ID) REFERENCES udf_role (ROLE_ID)
相关文章推荐
- [转]mysql在已有无分区表增加分区,mysql5.5才有,可以是innodb_file_per_table关闭状态.
- mysql之table关键字:alter (修改表,列名,增加修改删除列) (一)
- mysql在已有无分区表增加分区,mysql5.5才有,可以是innodb_file_per_table关闭状态.
- mysql出现“the table is full”的问题
- Mysql—— [Warning] Changed limits: max_open_files: 2048 max_connections:800 table_cache: 619
- jquery之table:给table动态增加行、清空table
- MySQL错误:You are using safe update mode and you tried to update a table without a WHERE that uses a K
- MySQL: [ERROR] /usr/sbin/mysqld: Incorrect key file for table './xxx/xxxx.MYI'; try to repair it
- MySQL中表复制:create table like 与 create table as select
- mysql利用init-connect增加访问审计功能
- 通过运行sql文件增加mysql不存在的列
- 做Mysql主从时,注意使用replicate_wild_do_table和replicate-wild-ignore-table【转】
- mysql中OPTIMIZE TABLE的作用
- mysql 外键约束不能重名ERROR 1005 (HY000): Can't create table 'prize.tb_power' (errno: 121)
- mysql table is marked as crashed and last (automatic?) repair failed
- Linux下MySQL报Table 'xxx' doesn't exist错误解决方法
- mysql建表出现Error Code : 1005;Can't create table 'table' (errno: 121)
- mysql的"Incorrect key file for table '/tmp/#sql_1194_12.MYI'; try to repair it"问题
- MySql 添加主外键约束遇到 "unknown table engine innodb"
- mysql flush table 对查询的影响