执行sql语句正常

执行存储过程 异常

提示

Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='

解决办法

CREATE PROCEDURE `proce_test`(admin_name VARCHAR(32) charset utf8)

问题描述:MySQL进行字符串比较时发生错误:

错误如下:


解决方法:将比较等式一边进行字符串转换,如改为“CONVERT(b.fullCode USING utf8) COLLATE utf8_unicode_ci

SELECT
a.equ_no,
b.fullCode
FROM
equipment a,
(
SELECT
t.*, getEquTypeFullCode (t.equType_id) AS fullCode
FROM
equ_type t
) b
WHERE
substring(a.equ_no, 1, 5) = CONVERT(b.fullCode USING utf8) COLLATE utf8_unicode_ci;

mysql调用存储过程出现Illegal mix of collations错误的更多相关文章

  1. MySQL查询时报错Illegal mix of collations

    开发十年,就只剩下这套架构体系了! >>>   1.具体场景 两张表分别为: CREATE TABLE `tb_user` ( `id` bigint(20) NOT NULL AU ...

  2. 【mysql】[Err]1267 - Illegal mix of collations(utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=

    ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

  3. 彻底解决phpcms v9升级后,文章发布出现: Mysql 1267错误:MySQL Error : Illegal mix of collations 解决办法

    彻底解决phpcms v9升级后,文章发布出现: MySQL Query : SELECT * FROM `withli_a`.`v9_keyword` WHERE `keyword` = '吼吼' ...

  4. 解决Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER

    今天在用java与mysql数据库时发现Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER ...

  5. Illegal mix of collations for operation 'like' while searching with Ignited-Datatables

    Stack Overflow Questions Developer Jobs Tags Users   Log In Sign Up Join Stack Overflow to learn, sh ...

  6. MySQL replication illegal mix of collations

    MySQL replication case 一则 转载:http://www.vmcd.org/2013/09/mysql-replication-case-%E4%B8%80%E5%88%99/ ...

  7. Mysql Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='

    MySQL字符串比较bug: select * from table_a a left join table_b b on a.field_a = b.field_b   error: Illegal ...

  8. MySQL Error: Illegal mix of collations for operation 'concat'

    在使用concat连接字符串时出现错误:MySQL Error: Illegal mix of collations for operation 'concat' 原因:字段操作默认为UTF8的编码, ...

  9. mysql 客户端连接报错Illegal mix of collations for operation

    服务端用的是utf-8,客户端工具打开表和视图是会报Illegal mix of collations for operation错误,经排查,可以采用以下语句解决 SET character_set ...

随机推荐

  1. RMQ问题心得

    RMQ(Range Minimum/Maximum Query)问题是指:对于长度为n的数列A,回答若干询问RMQ(A,i,j),返回数列A中下标i,j里的最小/大值,即RMQ问题是指求区间最值的问题 ...

  2. [Python Debug]Kernel Crash While Running Neural Network with Keras|Jupyter Notebook运行Keras服务器宕机原因及解决方法

    最近做Machine Learning作业,要在Jupyter Notebook上用Keras搭建Neural Network.结果连最简单的一层神经网络都运行不了,更奇怪的是我先用iris数据集跑了 ...

  3. python3爬虫爬取煎蛋网妹纸图片(上篇)

    其实之前实现过这个功能,是使用selenium模拟浏览器页面点击来完成的,但是效率实际上相对来说较低.本次以解密参数来完成爬取的过程. 首先打开煎蛋网http://jandan.net/ooxx,查看 ...

  4. CentOS5.5下直接安装MySQL5.6

    1.安装平台:CentOS5.5 2.由于从MySQL5.0升到MySQL5.6出现重大问题,为了不影响进度,暂时先直接安装MySQL5.6 2.1首先确认yum源,这里使用http://repo.m ...

  5. [BZOJ2655]calc(拉格朗日插值法+DP)

    2655: calc Time Limit: 30 Sec  Memory Limit: 512 MBSubmit: 428  Solved: 246[Submit][Status][Discuss] ...

  6. 【分治】计算概论(A) / 函数递归练习(1)多边形游戏

    #include<cstdio> #include<algorithm> using namespace std; ],c[],s[]; int work(int L,int ...

  7. 【矩阵乘法+快速乘】BZOJ2875-[NOI2012]随机数生成器

    [题目大意] 已知Xn+1=(aXn+c) mod m,求Xn mod g. [思路] get到了longlong乘法的正确方法,快速乘.什么是快速乘呢? 简单来讲,快速幂就是模拟了二进制的竖式乘法. ...

  8. Exercise03_02

    import java.util.Scanner; public class AdditionQuiz { public static void main(String[] args){ int nu ...

  9. java web定时任务---Timer

    写在前面: 在最近的项目中需要每天定时对数据库表进行查询,并完成相关数据的更新操作.首先让我想到的是Timer类,记得在一开始维护那个老系统的时候,开了个接口,也涉及到了定时的操作.下面就记录下大概的 ...

  10. Ajax 使用formdata 实现 无刷新表单上传

    FormData对象的作用就类似于这里的serialize()方法,不过FormData是浏览器原生的,且支持二进制文件 1.这里实现一个无刷新上传图片,成功后页面显示 点击button 触发隐藏的 ...