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),我在网上找了好久类似的问题方法一一试遍了就是解决不了希望各们高手们帮忙解答下,万分感谢了!