mysql - ERROR 1005 (HY000): Can't create table 'tracker_phonetracker.location_share' (errno: -1) -
i facing problem in query .
create table location_share ( circle_id int , user_id int , location_sharing_id int , primary key (user_id ,circle_id ) , constraint fkcircle1 foreign key (circle_id) references circle(id) on delete cascade on update cascade , constraint fkuser1 foreign key (user_id) references user(id) on delete cascade on update cascade , constraint fksharing_policy foreign key (location_sharing_id) references share(id) on delete cascade on update cascade ) engine = innodb
mysql shows me error 1005 :
error 1005 (hy000): can't create table 'tracker_phonetracker.location_share' (errno: -1)
other tables on query dependent :
table : circle
create table circle ( id int auto_increment primary key , name varchar(35) ) engine=innodb
table : user
create table user ( id int auto_increment primary key , contact_no varchar(25) unique not null, email varchar(50) unique not null, first_name varchar(25) not null , last_name varchar(25) , device_id varchar(250)not null , image_path varchar(180) , password varchar(30) not null , latitude varchar(18) , longitude varchar(18) ) engine=innodb
table : share
create table share ( id int auto_increment primary key , policy varchar(6) unique not null )
can plz tell me what's wrong query .
thanks !!
from manual: http://dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html
1005 (er_cant_create_table)
cannot create table. if error message refers error 150, table creation failed because foreign key constraint not correctly formed. if error message refers error −1, table creation failed because table includes column name matched name of internal innodb table.
this caused using user
can fix escaping references user
:
references `user`(id)
Comments
Post a Comment