There is a correspondence between database and table identifiers and names in the file system. For the basic structure, MySQL represents each database as a directory in the data directory, and depending upon the storage engine, each table may be represented by one or more files in the appropriate database directory.数据库和表的标识符以及文件系统中的名称之间存在对应关系。对于基本结构,MySQL将每个数据库表示为数据目录中的一个目录,根据存储引擎的不同,每个表可能由适当数据库目录中的某个或多个文件表示。
For the data and index files, the exact representation on disk is storage engine specific. These files may be stored in the database directory, or the information may be stored in a separate file. 对于数据和索引文件,磁盘上的确切表示方式是特定于存储引擎的。这些文件可以存储在数据库目录中,或者信息可以存储在单独的文件中。InnoDB
data is stored in the InnoDB data files. InnoDB
数据存储在InnoDB
数据文件中。If you are using tablespaces with 如果您在InnoDB
, then the specific tablespace files you create are used instead.InnoDB
中使用表空间,那么将使用您创建的特定表空间文件。
Any character is legal in database or table identifiers except ASCII NUL (除ASCII NUL(X'00'
). MySQL encodes any characters that are problematic in the corresponding file system objects when it creates database directories or table files:X'00'
)外,数据库或表标识符中的任何字符都是合法的。MySQL在创建数据库目录或表文件时,对相应文件系统对象中有问题的任何字符进行编码:
Basic Latin letters (基本拉丁字母(a..zA..Z
), digits (0..9
) and underscore (_
) are encoded as is. Consequently, their case sensitivity directly depends on file system features.a..zA..Z
)、数字(0..9
)和下划线(_
)按原样编码。因此,它们的大小写敏感性直接取决于文件系统功能。
All other national letters from alphabets that have uppercase/lowercase mapping are encoded as shown in the following table. Values in the Code Range column are UCS-2 values.字母表中具有大小写映射的所有其他国家字母的编码如下表所示。“代码范围”列中的值为UCS-2值。
Code Range | Pattern | Number | Used | Unused | Blocks |
---|---|---|---|---|---|
00C0..017F | [@][0..4][g..z] | 5*20= 100 | 97 | 3 | |
0370..03FF | [@][5..9][g..z] | 5*20= 100 | 88 | 12 | |
0400..052F | [@][g..z][0..6] | 20*7= 140 | 137 | 3 | |
0530..058F | [@][g..z][7..8] | 20*2= 40 | 38 | 2 | |
2160..217F | [@][g..z][9] | 20*1= 20 | 16 | 4 | |
0180..02AF | [@][g..z][a..k] | 20*11=220 | 203 | 17 | |
1E00..1EFF | [@][g..z][l..r] | 20*7= 140 | 136 | 4 | |
1F00..1FFF | [@][g..z][s..z] | 20*8= 160 | 144 | 16 | |
.... .... | [@][a..f][g..z] | 6*20= 120 | 0 | 120 | |
24B6..24E9 | [@][@][a..z] | 26 | 26 | 0 | |
FF21..FF5A | [@][a..z][@] | 26 | 26 | 0 |
One of the bytes in the sequence encodes lettercase. For example: 序列中的一个字节对字母大小写进行编码。例如:LATIN CAPITAL LETTER A WITH GRAVE
is encoded as @0G
, whereas LATIN SMALL LETTER A WITH GRAVE
is encoded as @0g
. LATIN CAPITAL LETTER A WITH GRAVE
被编码为@0G
,而LATIN SMALL LETTER A WITH GRAVE
被编为@0g
。Here the third byte (这里,第三个字节(G
or g
) indicates lettercase. (On a case-insensitive file system, both letters are treated as the same.)G
或g
)表示字母大小写。(在不区分大小写的文件系统中,两个字母被视为相同。)
For some blocks, such as Cyrillic, the second byte determines lettercase. For other blocks, such as Latin1 Supplement, the third byte determines lettercase. If two bytes in the sequence are letters (as in Greek Extended), the leftmost letter character stands for lettercase. All other letter bytes must be in lowercase.对于某些块,如西里尔字母,第二个字节决定了字母大小写。对于其他块,如Latin1 Supplement,第三个字节决定大小写。如果序列中的两个字节是字母(如希腊语扩展),则最左边的字母字符代表字母大小写。所有其他字母字节都必须小写。
All nonletter characters except underscore (除下划线(_
), as well as letters from alphabets that do not have uppercase/lowercase mapping (such as Hebrew) are encoded using hexadecimal representation using lowercase letters for hexadecimal digits a..f
:_
)外的所有非字母字符,以及来自没有大小写映射的字母表的字母(如希伯来语),都使用十六进制表示法进行编码,使用小写字母表示十六进制数字a..f
:
0x003F -> @003f 0xFFFF -> @ffff
The hexadecimal values correspond to character values in the 十六进制值对应于ucs2双字节字符集中的字符值。ucs2
double-byte character set.
On Windows, some names such as 在Windows上,当服务器创建相应的文件或目录时,某些名称(如nul
, prn
, and aux
are encoded by appending @@@
to the name when the server creates the corresponding file or directory. nul
、prn
和aux
)通过在名称后附加@@@
进行编码。This occurs on all platforms for portability of the corresponding database object between platforms.这发生在所有平台上,以便在平台之间可移植相应的数据库对象。