Mysql
 sql >> Baza danych >  >> RDS >> Mysql

Ograniczenie klucza obcego MySQL 5.5 nie działa, gdy klucz obcy istnieje

Wygląda na to, że jest to błąd wprowadzony od wersji MySQL 5.5.9 w systemie Mac OS X:http ://bugs.mysql.com/bug.php?id=60309

Jest oznaczony jako naprawiony w 5.5.13 (wydany 31 maja) i wymieniony w informacjach o wydaniu:http://dev.mysql.com/doc/refman/5.5/en/news-5-5-13.html

Alternatywnie, istnieje obejście wymienione w raporcie o błędzie, które zweryfikowałem w wersji 5.5.10 i odtworzyłem poniżej:

[20 Mar 11:29] Harald Neiss

I also received a new MBP and reinstalled MySQL (mysql-5.5.10-osx10.6-x86_64). Finally I
came across the same problem as described above. So here is the query result and what I
did to solve it.

mysql> show variables like 'lower%';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_file_system | ON    |
| lower_case_table_names | 2     |
+------------------------+-------+
2 rows in set (0.00 sec)

Dropped database, created the file /etc/my.cnf with the following content:

[mysqld]
lower_case_table_names=1

Restarted the MySQL daemon and repeated the query:

mysql> show variables like 'lower%';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_file_system | ON    |
| lower_case_table_names | 1     |
+------------------------+-------+
2 rows in set (0.00 sec)

I recreated the tables and everything works fine.



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. MySQL JOIN z warunkami IF

  2. Entity Framework + generowanie klas MySQL

  3. MySQL:jak uzyskać długość tekstu w kolumnie?

  4. Jak zaimportować plik SQL za pomocą wiersza poleceń w MySQL?

  5. sprawdź, czy wynik zapytania jest pustym wierszem mysqli