Comments - MariaDB 10.5.8 Foreign Key Constraint Error

3 年, 1 ヶ月 ago Ian Gilfillan

What do you mean by "cannot work"? Can you share the error message, as well as all character set/collation-related settings?

 
3 年, 1 ヶ月 ago Xiaohua Zhang

Hi, Thanks for your quick response.

The last line produces the following error message in MariaDB 10.5.8.

ERROR 1005 (HY000): Can't create table `db21`.`販売表` (errno: 150 "Foreign key constraint is incorrectly formed")

The values of character set and collation variables are as follows which are complete the same as in MariaDB 10.4.12 (I installed both versions in two Note PCs individually. The two PCs are the same type.)

MariaDB [DB21]> show variables like '%char%';
+---------------------------------+-----------------------------------------------+
| Variable_name                 | Value                                               |
+----------------------------------+----------------------------------------------+
| character_set_client          | cp932                                             |
| character_set_connection | cp932                                             |
| character_set_database    | utf8                                                |
| character_set_filesystem   | binary                                            |
| character_set_results        | cp932                                             |
| character_set_server         | utf8                                                |
| character_set_system       | utf8                                                 |
| character_sets_dir             | C:\Program Files\MariaDB 10.5\share\charsets\ |
+-----------------------------------+-----------------------------------------------+

MariaDB [DB21]> show variables like '%collation%';
+---------------------------+---------------------------+
| Variable_name          | Value                       |
+----------------------------+--------------------------+
| collation_connection | cp932_japanese_ci |
| collation_database    | utf8_general_ci       |
| collation_server         | utf8_general_ci       |
+----------------------+--------------------------------+

Thank you!

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.