您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

快速解决MySQL数据库字符集的出错问题_MySQL

2024/2/24 14:07:07发布19次查看
出现错误的示例:
illegal mix of collations (gbk_chinese_ci,implicit) and (gbk_bin,implicit) for operation '=', sql state: hy000, error code: 1267
原因:
数据库的编码与建表时的编码不一样;
处理方法:
如果安装mysql时设置的编码为jbk,那么建表时可以用下面的方法处理:
create table `teachers` (id` int(11) not null default '0',name` varchar(20) default null,password` varchar(20) default null,department_id` int(11) default null,primary key (`id`)) engine=myisam default charset=gbk;
或者用下面的方法:
create table `teachers` (id` int(11) not null default '0',name` varchar(20) default null,password` varchar(20) default null,department_id` int(11) default null,primary key (`id`)) ;
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product