檢查 MySQL 表列字元集的查詢是什麼?


以下查詢用於檢查 MySQL 表中列的字元集 −

mysql> Select Column_name 'Column', Character_set_name 'Charset' FROM
       information_schema.columns where table_schema = 'db_name' and
       table_name ='table_name';

示例

例如,以下查詢返回名為 “sample” 資料庫中 “test_char_set” 表中各列的名稱以及這些列的字元集。

mysql> Select Column_name 'Column', Character_set_name 'Charset' FROM
       information_schema.columns where table_schema = 'Sample' and
       table_name ='test_char_set';

+--------+---------+
| Column | Charset |
+--------+---------+
| Name   | latin1  |
| Field  | latin1  |
+--------+---------+
2 rows in set (0.03 sec)

更新於: 20-Jun-2020

418 次瀏覽

開啟你的職業

完成課程獲得認證

開始
廣告