Home  >  Article  >  Database  >  Can Database Names in MySQL 5.1.22 Contain Dots (.)?

Can Database Names in MySQL 5.1.22 Contain Dots (.)?

DDD
DDDOriginal
2024-10-28 22:43:30707browse

Can Database Names in MySQL 5.1.22 Contain Dots (.)?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn