修改/etc/my.cnf或者/etc/mysql/my.cnf文件 [client]default-character-set = utf8[mysqld]default-storage-engine = INNODBcharacter-set-server = utf8collation-server = utf8_general_ci 重启mysql,使用mysql客户端检查编码 show variab
修改/etc/my.cnf或者/etc/mysql/my.cnf文件
[client] default-character-set = utf8 [mysqld] default-storage-engine = INNODB character-set-server = utf8 collation-server = utf8_general_ci
重启mysql,使用mysql客户端检查编码
show variables like '%char%';
创建新数据库时使用UTF-8编码
create database 'test' default character set utf8 collate utf8_general_ci;
创建表,创建字段使用UTF-8编码
create table test ( 'id' int(10) unsigned not null auto_increment, 'name' varchar(50) character set utf8 default '', primary key('id') ) default charset=utf8;
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易盾网络。