When creating a foreign key in MySQL, an ERROR is prompted, but only the simple information is prompted: ERROR 1005 (HY000): Can't create table 'db _ qxztc. qx_userssssnew' (errno: 150 ). It cannot solve the problem at all.
To view the detailed error message, run the following command: (find "errno 150" in MySQL Manual)
Show engine innodb status; // for databases stored in INNODB
There is a group of [latest foreign key error] in which detailed descriptions of recent errors and solutions are provided.
For example:
111211 12:49:34 Error in foreign key constraint of table db_qxztc/qx_userssssnew
:
Foreign key ('ssssid ') references 'qx _ sssss' ('ssssid ')):
Syntax error close:
'Qx _ sssss' ('ssssid '))
The prompt is that there is a syntax error near 'qx _ sssss' ('ssssid '). You should check it carefully. The error I made here is between references and its parameters, space is missing ..