"/> ">

Home  >  Article  >  Database  >  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
WBOYforward
2023-09-16 19:45:021130browse

我们如何查看特定 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';

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)

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete