特此声明:一下方面为学习中在网络上面搜索所得,具体来源已经记不清楚。如有侵权请告知作者进行撤销,谢谢!
MySQL默认编码查询与更改
怎样修改MySQL数据库编码:(注意代码末尾的分号不要丢掉,分号为英文半角字符)
查看现在的编码:SHOW VARIABLES LIKE 'character%';
命令设置编码格式(临时不能永久保存):
SET character_set_client = utf8;
SET character_set_connection = utf8;
SET character_set_database = utf8;
SET character_set_filesystem = binary;
SET character_set_results = utf8;
SET character_set_server = utf8;
FLUSH PRIVILEGES;
配置文件设置(永久):
在MySQL安装目录下新建my.ini文件,内容为:
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
basedir = D:\Database\MySQL
datadir = D:\Database\MySQL\data
# port = .....
# server_id = .....
怎样修改MySQL数据库编码:(注意代码末尾的分号不要丢掉,分号为英文半角字符)
查看现在的编码:SHOW VARIABLES LIKE 'character%';
命令设置编码格式(临时不能永久保存):
SET character_set_client = utf8;
SET character_set_connection = utf8;
SET character_set_database = utf8;
SET character_set_filesystem = binary;
SET character_set_results = utf8;
SET character_set_server = utf8;
FLUSH PRIVILEGES;
配置文件设置(永久):
在MySQL安装目录下新建my.ini文件,内容为:
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
basedir = D:\Database\MySQL
datadir = D:\Database\MySQL\data
# port = .....
# server_id = .....