Resolve the ERROR 1005 solution when creating a foreign key in MySQL

Source: Internet
Author: User
Tags mysql manual

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 ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.