借助以下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中文網其他相關文章!