mysql中怎么直接查看一个表的字符集?

2024-12-13 05:00:12
推荐回答(1个)
回答1:

SELECT
table_name AS `表名`,
table_type AS `类型`,
engine AS `引擎`,
VERSIONAS`版本`,
TABLE_COLLATION AS `字符集`
FROM
information_schema.tables
WHERE
table_schema = 'test_utf8'
ORDER BY
table_name DESC;

+----------+------------+--------+------+-----------------+
| 表名 | 类型 | 引擎 | 版本 | 字符集 |
+----------+------------+--------+------+-----------------+
| test_tab | BASE TABLE | InnoDB | 10 | utf8_general_ci |
+----------+------------+--------+------+-----------------+
1 row in set (0.01 sec)