借助以下 MySQL 查询,我们可以检查特定数据库中所有表的字符集 -
mysql> Select Column_name, TABLE_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.Columns Where TABLE_SCHEMA = 'db_name';
例如,下面的查询返回名为“Alpha”的数据库中所有表的字符集以及列名。
mysql> Select Column_name 'Column',TABLE_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.Columns Where TABLE_SCHEMA = 'Alpha'; +---------+------------+--------------------+ | Column | TABLE_NAME | CHARACTER_SET_NAME | +---------+------------+--------------------+ | Name | employee | latin1 | | email | employee | latin1 | | Name | student | latin1 | | RollNo | student | NULL | | Address | student | latin1 | +---------+------------+--------------------+ 5 rows in set (0.04 sec)
以上是如何检查特定 MySQL 数据库中所有表的字符集以及列名?的详细内容。更多信息请关注PHP中文网其他相关文章!