mysql查詢表字符集編碼的兩種方法:1、使用“show table status”語句查看指定數據庫中指定表的字符集編碼,語法“show table status from 庫名 like 表名;”。2、使用“show columns”語句配合full關鍵字查看當前數據庫中指定表所有列的字符集編碼,語法“show full columns from 表名;”。

本教程操作環境:windows7系統、mysql8版本、Dell G3電腦。
mysql查詢表字符集編碼的兩種方法
1、使用show table status語句查看指定表的字符集編碼
SHOW TABLE STATUS命令可以獲取指定數據庫中每個數據表的信息,包括字符集編碼。
show table status from 數據庫名;
但只想獲取指定表的信息,就可利用like進行限制:
show table status from 庫名 like 表名;
示例:查看class_7數據庫中test_info表的字符集編碼
show table status from class_7 like 'test_info';
mysql> show table status from class_7 like 'test_info'; +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+- | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_leate_time | Update_time | Check_time | Collation | Checksum | +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+- | test_info | InnoDB | 10 | Compact | 10 | 1638 | 17-12-05 19:01:55 | NULL | NULL | utf8_general_ci | NULL | +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+- 1 row in set (0.00 sec)

2、使用show columns語句配合full關鍵字查看當前數據庫中指定表中所有列的字符集編碼
在mysql中,SHOW COLUMNS命令可以顯示表的列信息,而要獲取有關列的
站長資訊網