문제

I am getting error #1005 - Can't create table (errno: 150).

I have been through the checklist of:

  • both tables are InnoDB
  • the columns are the same type (INT)
  • attributes are the same (UNSIGNED NOT NULL)
  • the collation is the same
  • I have tried with indexes on the foreign keys, it still doesn't work (and they shouldn't be needed for MySQL 5)
도움이 되었습니까?

해결책

The problem was with my syntax. Instead of

REFERENCES `table`.`col`

it should be

REFERENCES `table` (`col`)

This question can be deleted.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top