Error Code : 1005
Can't create table 'DatabaseName.#sql-9cc_1' (errno: 150)
(0 ms taken)
After searching a lot i have got solution for the above problem while i was adding FK to a column.
The error was because of different MySQL engine. There are different MySQL engines and the table i had PK
(Primary Key ) was on InnoDB Engine and the other table on which i was putting FK (Foreign Key)constraint was on MyISAM Engine.
Change MySQL Engine using following Command
ALTER TABLE blob_data ENGINE=InnoDB;
Now Add Constraint Foring Key as:
ALTER TABLE users_role_map
ADD CONSTRAINT FK_users_role_map1
FOREIGN KEY (email) REFERENCES usert(email)
ON UPDATE CASCADE
ON DELETE CASCADE
If still not able to solve the issue,follow the link below :
Read the link data you may find the solution.
stackoverflow.com
0 Comment(s)