–查看數據庫的字符集
show variables like 'character\_set\_%';
show variables like 'collation_%';
–設置數據庫字符編碼
set names 'GBK'
alter database payment character set GBK;
create database mydb character set GBK;
set character_set_client=gbk;
set character_set_connection=gbk;
set character_set_database=gbk;
set character_set_results=gbk;
set character_set_server=gbk;
set character_set_system=gbk;
set collation_connection=gbk;
set collation_database=gbk;
set collation_server=gbk;