zoukankan      html  css  js  c++  java
  • ERROR 1366 (HY000): Incorrect string value:MySQL数据库、表的字符集为GBK

    mysql> update userinfo set MEDIASOURCE = 'CS02-北京' where IMPORTNO = 'IMP201640613101206';
    ERROR 1366 (HY000): Incorrect string value: 'x91' for column 'MEDIASOURCE' at row 1

    mysql> show variables like '%char%';
    +--------------------------+----------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------+
    | character_set_client | gbk |
    | character_set_connection | gbk |
    | character_set_database | gbk |
    | character_set_filesystem | binary |
    | character_set_results | gbk |
    | character_set_server | gbk |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    8 rows in set (0.00 sec)

    mysql> set character_set_client =utf8;
    Query OK, 0 rows affected (0.00 sec)

    mysql> set character_set_server =utf8;
    Query OK, 0 rows affected (0.00 sec)

    mysql> show variables like '%char%';
    +--------------------------+----------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------+
    | character_set_client | utf8 |
    | character_set_connection | gbk |
    | character_set_database | gbk |
    | character_set_filesystem | binary |
    | character_set_results | gbk |
    | character_set_server | utf8 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    8 rows in set (0.00 sec)

    mysql> update userinfo set MEDIASOURCE = 'CS02-北京' where IMPORTNO = 'IMP201640613101206';
    Query OK, 169 rows affected (0.03 sec)
    Rows matched: 169 Changed: 169 Warnings: 0

  • 相关阅读:
    怎么快速掌握一门新技术
    Linq相关
    C# 参数按照ASCII码从小到大排序(字典序)
    测试工具
    sql 创建临时表
    sql行合并
    WCF相关
    免费开源分布式系统日志收集框架 Exceptionless
    VPS,虚拟主机,云主机,独立服务器区别
    c# Dictionary的遍历和排序
  • 原文地址:https://www.cnblogs.com/elontian/p/9185309.html
Copyright © 2011-2022 走看看