PRIMARY KEY (Id ) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='测试表'; 以上就是Illegal mix of collations (latin1
int(11) NOT NULL AUTO_INCREMENT COMMENT '前台id' , `d_name` varchar(10) CHARACTER SET latin1 COLLATE latin1..._swedish_ci NULL DEFAULT NULL COMMENT '姓名' , `d_password` varchar(10) CHARACTER SET latin1 COLLATE latin1..._swedish_ci NULL DEFAULT NULL COMMENT '顾客编号' , `g_name` varchar(100) CHARACTER SET latin1 COLLATE latin1..._swedish_ci NULL DEFAULT NULL COMMENT '姓名' , `g_sex` varchar(10) CHARACTER SET latin1 COLLATE latin1...11) NOT NULL AUTO_INCREMENT COMMENT 'roo id' , `r_type` varchar(100) CHARACTER SET latin1 COLLATE latin1
-R Relcom Russian | koi8r_general_ci | 1 | | latin1 | cp1252 West European | latin1...-----+----------+---------+ | latin1_german1_ci | latin1 | 5 | | | 0 | | latin1...+---------+----+---------+----------+---------+ latin1校对规则有下面的含义: 校对规则 含义 latin1_german1_ci 德国DIN-1 latin1...例如,latin1默认校对规则是latin1_swedish_ci。
0.00 sec) +———————-+——————-+ | Variable_name | Value | +———————-+——————-+ | collation_connection | latin1..._swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci |
若无自动创建)的字符集为 latin1 -- cp1252 West European 此字符集将会在生成查询语句包含中文的时候报如下错误 异常信息 Illegal mix of collations (latin1...COERCIBLE) for operation '='MySql.Data.MySqlClient.MySqlException (0x80004005): Illegal mix of collations (latin1...for operation '=' ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Illegal mix of collations (latin1
`user` ( `id` int(11) NOT NULL AUTO_INCREMENT , `name` varchar(255) CHARACTER SET latin1 COLLATE latin1...swedish_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=latin1 COLLATE=latin1...latin5 NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=latin1 COLLATE=latin1...int(11) NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=latin1 COLLATE=latin1...int(11) NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=latin1 COLLATE=latin1
NULL, `student_id` int(11) NULL DEFAULT NULL, `name` varchar(255) CHARACTER SET latin1 COLLATE latin1...NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1...NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1
| Value | +----------------------+-------------------+ | collation_connection | latin1..._swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci
--------+-------------------+ | collation_connection | utf8_general_ci | | collation_database | latin1..._swedish_ci | | collation_server | latin1_swedish_ci | +----------------------+------------------
----------+-------------------+ | collation_connection | utf8_general_ci | | collation_database | latin1..._swedish_ci | | collation_server | latin1_swedish_ci | +----------------------+-------------------+
CREATE TABLE `emp` ( `empno` int(4) NOT NULL, `ename` varchar(10) CHARACTER SET latin1 COLLATE latin1..._swedish_ci NULL DEFAULT NULL, `job` varchar(9) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL...DEFAULT NULL, PRIMARY KEY (`empno`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1...CREATE TABLE `dept` ( `deptno` int(2) NOT NULL, `dname` varchar(14) CHARACTER SET latin1 COLLATE latin1..._swedish_ci NULL DEFAULT NULL, `loc` varchar(13) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL
`test` ( `id` int(11) NOT NULL COMMENT 'ID', `name` varchar(255) CHARACTER SET latin1 COLLATE latin1...NULL COMMENT '姓名', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1
--------+-------------------+ | collation_connection | utf8_general_ci | | collation_database | latin1..._swedish_ci | | collation_server | latin1_swedish_ci | +----------------------+------------------...| | NULL | | select,insert,update,references | | | nickname | varchar(50) | latin1...| | 0 | | select,insert,update,references | | | age | varchar(7) | latin1...-R Relcom Russian | koi8r_general_ci | 1 | | latin1 | cp1252 West European | latin1
NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION comment: character_set_client: latin1 collation_connection: latin1..._swedish_ci db_collation: latin1_swedish_ci body_utf8: begin select ename into out_ename...50 | NULL | NULL | NULL | latin1 | latin1
`username_` bigint(255) NOT NULL AUTO_INCREMENT , `id_` varchar(255) CHARACTER SET latin1 COLLATE latin1..._swedish_ci NULL DEFAULT NULL , `password_` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci...NULL DEFAULT NULL , PRIMARY KEY (`username_`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1
DEFAULT] COLLATE collation_name] 例如: CREATE DATABASE db_name DEFAULT CHARACTER SET latin1 COLLATE latin1...相反,因为latin1的默认校对规则总是latin1_swedish_ci,列c1有一个校对规则latin1_swedish_ci(而不是latin1_danish_ci)。
排查 我再查看mysql数据库表是格式是latin1_swedish_ci,我就改为对应的utf8_general_ci,再次测试上传图文,这时候还是报同样的异常。
4.2.1 数据库的设置在创建数据库的时候可以指定该数据库所使用的字符集与字符序:CREATE DATABASE db_name CHARACTER SET latin1 COLLATE latin1_..._swedish_ci;这里数据库的字符集就是latin1,字符序就是latin1_swedish_ci。...那字符集就是这个值,而字符序就是字符集的默认字符序:CREATE DATABASE db_name CHARACTER SET latin1;字符集就是latin1,字符序就是latin1的默认字符序latin1...如果创建数据库时指定了字符序而没有指定字符集,那么字符集就是该字符序所对应的字符集:CREATE DATABASE db_name CHARACTER COLLATE latin1_swedish_ci...;字符序就是latin1_swedish_ci,字符集就是这个字符序关联的字符集latin1。
return (select name from user_info where id=uid) | utf8 | utf8_general_ci | latin1...queryNameById`(In uid int(15)) begin select name from user_info where id=uid; end | utf8 | utf8_general_ci | latin1
领取专属 10元无门槛券
手把手带您无忧上云