Can MySQL Databases Contain Dots?
MySQL users may encounter a common naming convention query: can database names include dots (.)? Specifically for MySQL 5.1.22 users.
Answer:
No, MySQL does not allowデータベース名包含periods (ドット). This also extends to any other type of identifier. The suggested alternative is to use underscores (_) instead. This practice serves the same purpose and avoids confusion.
However, if you require the use of special characters in table or field names, you must escape them.
Escaping Identifiers in MySQL:
Use backticks to escape identifiers in MySQL:
SELECT `select`, `some.field name`, `crazy()naming+here` FROM `my-=+table`
The backtick should be applied to all field names, even if not necessary, as a recommended practice.
The above is the detailed content of Can Database Names in MySQL 5.1.22 Contain Dots (.)?. For more information, please follow other related articles on the PHP Chinese website!