Home > Database > Mysql Tutorial > body text

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

DDD
Release: 2024-10-28 22:43:30
Original
706 people have browsed it

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`
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!