查詢方法:1、用“show variables like 'character%'”命令,可查詢整個(gè)庫的編碼;2、用“show table status from 表名 like "%yxfx_zxxx_fyb%"”命令,可查詢指定表編碼。
本教程操作環(huán)境:windows7系統(tǒng)、mysql8版本、Dell G3電腦。
mysql查詢編碼
方式一:查詢整個(gè)庫的編碼
show variables like 'character%'
其中,
-
character_set_client為客戶端編碼方式;
-
character_set_connection為建立連接使用的編碼;
-
character_set_database數(shù)據(jù)庫的編碼;
-
character_set_results結(jié)果集的編碼;
-
character_set_server數(shù)據(jù)庫服務(wù)器的編碼;
只要保證以上四個(gè)采用的編碼方式一樣,就不會出現(xiàn)亂碼問題。
方式二:查詢指定表的編碼
使用一下命令:
show table status from 表名 like "%yxfx_zxxx_fyb%"
【