Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create table with unicode characters in the name

Tags:

mysql

I create a table in 【Navicate for MySQL】,but can't complete it.

this is my code.

CREATE table `成绩表`(
`学号` char(10),
`课号` char(10),
`成绩` int,
PRIMARY KEY(`学号`, `课号`)
)

error:
[SQL] CREATE table `成绩表`(
`学号` char(10),
`课号` char(10),
`成绩` int,
PRIMARY KEY(`学号`, `课号`)
)

[Err] 1005 - Can't create table '成绩表' (errno: 22)
like image 627
Chuxin Avatar asked Jan 08 '12 15:01

Chuxin


1 Answers

According to MySQL manual it is able to handle unicode from U+0001 up to U+FFFF for table and column names - so the reason for you see most likely will need some digging:

The error message says errno is 22 which IIRC translates into the OS error code for invalid argument. That in turn means that somewhere along the way deep inside MySQL itself there is some function called with an argument that it can't accept.

I would suspect that the function called is from the C runtime and/or OS and that it is most likely filesystem related.

That in turn means it is either a bug or some obscure behaviour of MySQL interacting with the OS/filesystem/setup you are using...

I would recommend to definitely contact MySQL/Oracle about this since that is IMHO far beyond what SO can handle...

like image 183
Yahia Avatar answered Oct 27 '22 19:10

Yahia