Home > Database > Mysql Tutorial > How can we check the default character set of a specific MySQL database?

How can we check the default character set of a specific MySQL database?

WBOY
Release: 2023-09-16 19:45:02
forward
1240 people have browsed it

我们如何查看特定 MySQL 数据库的默认字符集?

The following is a query to check the default character set for a specific MySQL database -

mysql> SELECT SCHEMA_NAME 'DatabaseName', default_character_set_name 'Charset' FROM information_schema.SCHEMATA where schema_name = 'db_name';
Copy after login

Example

For example, the following query will return a query named "Sample "Default character set of the database-

mysql> SELECT SCHEMA_NAME 'DatabaseName', default_character_set_name 'Charset' FROM information_schema.SCHEMATA where schema_name = 'Sample';
+----------------+---------+
| DatabaseName   | Charset |
+----------------+---------+
| Sample         | latin1  |
+----------------+---------+
1 row in set (0.00 sec)
Copy after login

The above is the detailed content of How can we check the default character set of a specific MySQL database?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
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