|
|
|
Внешние ключи
|
|||
|---|---|---|---|
|
#18+
Вощем создаю таблицы в будующей БД-справочнике. но на создании такой вот таблицы Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. ругается "типа key violation. не могу создать таблицу.... errno:150". такие дела. Таблицы Steel и Сhemical_elements_ref созданы . ID у всех таблиц как и в этой. Что не так скажите пжлст!!! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.09.2004, 17:28 |
|
||
|
Внешние ключи
|
|||
|---|---|---|---|
|
#18+
Версия mysql меньше 4.1.2? Кусок документации: MySQL If MySQL reports an error number 1005 from a CREATE TABLE statement, and the error message string refers to errno 150, this means that the table creation failed because a foreign key constraint was not correctly formed. Similarly, if an ALTER TABLE fails and it refers to errno 150, that means a foreign key definition would be incorrectly formed for the altered table. Starting from MySQL 4.0.13, you can use SHOW INNODB STATUS to display a detailed explanation of the latest InnoDB foreign key error in the server. По русски говоря первым делом после этой ошибки посмотри show innodb status, чтобы определиться, где именно проблема. Но скорее всего что-то из MySQL AB Corresponding columns in the foreign key and the referenced key must have similar internal data types inside InnoDB so that they can be compared without a type conversion. The size and the signedness of integer types has to be the same. The length of string types need not be the same. If you specify a SET NULL action, make sure that you have not declared the columns in the child table as NOT NULL ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.09.2004, 18:12 |
|
||
|
|

start [/forum/topic.php?desktop=1&fid=47&tid=1854808]: |
0ms |
get settings: |
7ms |
get forum list: |
12ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
170ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
44ms |
get tp. blocked users: |
1ms |
| others: | 248ms |
| total: | 498ms |

| 0 / 0 |
