| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 543 人关注过本帖
标题:MYSQl中定义外键出问题了
只看楼主 加入收藏
david168520
Rank: 2
来 自:湖北
等 级:论坛游民
帖 子:227
专家分:50
注 册:2009-2-16
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:1 
MYSQl中定义外键出问题了
create database Loan;
use Loan;
create table student(number varchar(10) not null primary key,name varchar(10) not null,loanNumber varchar(10),
ID varchar(20) not null,sex varchar(5) not null,birthday varchar(50) not null,enterSchoolTime varchar(50) not null,address varchar(50),
postID varchar(10) not null,telNumber varchar(15),class varchar(50),academy varchar(50),major varchar(20),
loanType int,loanAmount int,loanState varchar(10))TYPE=INNODB;

create table loan(loanNumber varchar(10) ,name varchar(10) not null,number varchar(10) not null ,
applyLoanTime varchar(20) not null,
class varchar(50),academy varchar(50),major varchar(20),
loanType int,loanAmount int,loanState varchar(10),FOREIGN KEY (loanNumber,name,number,class,academy,major,loanType,loanAmount,loanState)
REFERENCES student(loanNumber,name,number,class,academy,major,loanType,loanAmount,loanState),primary key(number,loanNumber))TYPE=INNODB;
create unique index index_loan on loan(loanNumber,name,number,class,academy,major,loanType,loanAmount,loanState);
这是我定义的数据库表,及索引,但在MYSQL命令行中运行时候提示出错了: Can't create table '.\loan\#sql-39c_25.frm' (errno: 150),我在网上找了好久类似的问题方法一一试遍了就是解决不了希望各们高手们帮忙解答下,万分感谢了!
搜索更多相关主题的帖子: MYSQl 定义 
2009-07-26 23:24
mx250052
Rank: 2
等 级:论坛游民
帖 子:61
专家分:25
注 册:2009-3-1
收藏
得分:20 
哇哇哇哇,我我我!还是没学到这!嘿嘿,楼主加油!
2009-07-29 10:17
快速回复:MYSQl中定义外键出问题了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020421 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved