Skip to main content

Posts

Showing posts with the label cannot

Why I cannot successfully create the foreign keys

Why I cannot successfully create the foreign keys From Navicat Wiki Jump to: navigation, search Apply OS : Windows, Mac, Linux Apply Navicat Product : Navicat for MySQL, Navicat for PostgreSQL, Navicat for SQLite, Navicat for Oracle, Navicat Premium Apply Navicat Version No. : All   MySQL If you recevie MySQL Error likes 1005: Cant create table .mydb#sql-44c_1c.frm(errno: 150) , it is caused by failure on creating Foreign Keys. There are some possible cases that might cause failure on creating Foreign Keys on MySQL database. These errors are related to MySQL itself. Example cases : If the two fields (Field name and the Foreign Field name) are using incompatible field type. If you use "On Delete Set Null" but the field doesnt allow null. To declare foreign keys in MySQL, there are few points which user should bear in mind : Both tables must be InnoDB type. In the referenced table, there must be an index where the referenced columns are listed as the f...