MySql字符集的設定總結

2021-08-14 20:55:59 字數 1164 閱讀 7648

1,修改資料庫字符集:

alter database db_name default character set character_name[collate ...];

2,修改表和所有字元列(char,varchar,text)的字符集:

alter table tb_name convert to character set character_name[collate ...]

例如:alter table users convert to character set utf8 collate utf8_general_ci;

3,只修改表的預設字符集:

alter table tb_name default character set character_name[collate ...];

例如:alter table users default character set utf8 collate utf8_general_ci;

4,修改欄位的字符集:

alter table tb_name change c_name c_name character set character_name[collate ...];

例如:alter table users change nick nick varchar(300) character set utf8 collate utf8_general_ci;

5,檢視資料庫編碼

,檢視表編碼

,檢視字段編碼

mysql字符集設定

show variables like char show variables like collation 2.修改編碼 set variable name value set character set connection utf8 3 顯示建立資料庫資訊 show create databa...

mysql 字符集設定

1.檢視mysql能夠支援的多種字符集 show character set 檢視mysql能夠支援的字符集的校對規則 show collation show collation like utf8 2.檢視當前字符集及校對 show variables like character set sho...

MySQL字符集設定

一 mysql字符集設定 1 系統變數 character set server 預設的內部操作字符集 character set client 客戶端 資料使用的字符集 character set connection 連線層字符集 character set results 查詢結果字符集 ch...