MySQL 8.0 Reference Manual Including MySQL NDB Cluster 8.0

11.2.4 Mapping of Identifiers to File Names

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.

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. If you are using tablespaces with InnoDB, then the specific tablespace files you create are used instead.

Any character is legal in database or table identifiers except 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:

On Windows, some names such as nul, prn, and aux are encoded by appending @@@ to the name when the server creates the corresponding file or directory. This occurs on all platforms for portability of the corresponding database object between platforms.

The following names are reserved and appended with @@@ if used in schema or table names:

CLOCK$ is also a member of this group of reserved names, but is not appended with @@@, but @0024 instead. That is, if CLOCK$ is used as a schema or table name, it is written to the file system as CLOCK@0024. The same is true for any use of $ (dollar sign) in a schema or table name; it is replaced with @0024 on the filesystem.


These names are also written to INNODB_TABLES in their appended forms, but are written to TABLES in their unappended form, as entered by the user.