Wednesday 15 April 2015

mysql - I am getting an error trying to create table in phpmyadmin -


I am trying to run the following:

  create a table, otherwise table_name (User_id) difference (user_id), other_ID int (11) no, woman, foreign key (user_id) reference user (id), foreign key (other_id) reference other_table (id), primary key (user_id, other_id));   

and getting the following error:

  # 1005 - Table 'database_name' can not create table_name '(errno: 150)   

Am I doing something wrong? It works fine, just running the phpmyadmin sql environment in another environment instead.

Take a look at this

Focus on the correct answer. Check the column types They need to match. Your problem may be

In general, here's the official guide.

In the case of foreign key error related to INODB tables, in addition to the errors shown, typically MySQL server error 150), you can check the output of the show engine Inb position, You can get a detailed description of the key error.

Edit: Including comments P>

The default on table MyISAM on PHPMyAdmin was InnoDB was not the default MySam does not support the FK. It is not fully understood about the difference, as it is based on, it should work only, without the FK. (Probably a setting problem or older version problem)

No comments:

Post a Comment