• Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 解决方法


    1. 代码

    SHOW VARIABLES LIKE 'character_set_%'; 查看一下 显示

    +--------------------------+----------------------------+

    | Variable_name | Value |

    +--------------------------+----------------------------+

    | character_set_client | utf8|

    | character_set_connection | utf8|

    | character_set_database | latin1 |

    | character_set_results | utf8|

    | character_set_server | latin1 |

    | character_set_system | utf8 |

    | character_sets_dir | /home/jh/mysql/share/mysql/charsets |

    2. 代码

    SHOW VARIABLES LIKE 'collation_%';

    +----------------------+-------------------+

    | Variable_name | Value |

    +----------------------+-------------------+

    | collation_connection | utf8_swedish_ci |

    | collation_database | latin1_swedish_ci |

    | collation_server | latin1_swedish_ci |

    +----------------------+-------------------+

    红色字体部分为问题部分,解决方法如下:

    set character_set_database =utf8;

    set character_set_results =utf8;

    set character_set_server =utf8;

    set character_set_system =utf8; --此处utf-8也可以

    然后执行:

    SET collation_server = utf8_general_ci;

    SET collation_database = utf8_general_ci;

    执行完以后,请检查mysql数据库下的每个库,表,字段是否都是utf8,如果不是话,改成utf8格式;3. 修改mysql安装目录下的my.ini文件

    [mysql]

    default-character-set=utf8

    配置好后,重启mysql。

    另外存储过程也需要注意一下。

  • 相关阅读:
    2019 滴滴java面试笔试总结 (含面试题解析)
    2019 阿里java面试笔试总结 (含面试题解析)
    Mangos笔记
    Google 多源码管理工具 gclient
    构建系统介绍
    Ninja介绍
    小试 Ninja
    如何使用Ninja快速编译LLVM和Clang
    FMS4中的P2P功能
    Flex之HTML5视频播放解决方案
  • 原文地址:https://www.cnblogs.com/peasana/p/4664679.html
Copyright © 2020-2023  润新知