Jump to content

Urgent Calling Dba's


Recommended Posts

Posted

ok sql script run chestuna tables create cheyadnki oka DB lo erro vastundi

 

ERROR 1005 (HY000): Can't create table 'tablename.database' (errno: 150)

Posted

ok sql script run chestuna tables create cheyadnki oka DB lo erro vastundi

 

ERROR 1005 (HY000): Can't create table 'tablename.database' (errno: 150)

 
2down voteaccepted

Errno 150 is generally the result of a mismatch between the exact data types of the main table's referenced column, and the referencing column. In your case, tracks.account_id is a signed INT, but the column it references accounts_profile.accnt_id is INT UNSIGNED. So you must create the tracks table using INT UNSIGNED for account_id as well:

CREATE TABLE tracks(
track_id int NOT NULL AUTO_INCREMENT,
account_id int UNSIGNED,
track_name varchar(255),
track_path varchar(255),
track_art_path varchar(255),
track_desc text,
primary key(track_id),
FOREIGN KEY (account_id) REFERENCES accounts_profile(accnt_id)
)
 
×
×
  • Create New...