• Mysql 插入中文错误:Incorrect string value: 'xE7xA8x8BxE5xBAx8F...' for column 'course' at row 1


    Incorrect string value: 'xE7xA8x8BxE5xBAx8F...' for column 'course' at row 1

    出现这个错误的原因是,数据库的编码格式为latin1 而我要将utf8的中文插入到数据库中。

    一开始修改  修改数据库的编码

    alter table score default character set utf8;
    但是插入中文依然出现错误。

    然后通过查看数据表编码

     

    show create table score;

    发现如下所示

    注意  course 的编码仍然为 latin1 ,虽然此时表的编码已经是 utf8 , 但是不知道为什么 列的编码没有更改过来

    下面就是更改列的编码即可

     alter table score change score score varchar(50) character utf8;

    修改成功之后

    结果是列的编码已经修改成功

     

    接下来插入utf8中文就没有问题了

     
    https://blog.csdn.net/ch717828/article/details/41357431
  • 相关阅读:
    顯示IP
    iPad开发学习之二HelloWorld及发布ipa
    转:iphone/ipad网站开发技巧整理
    poj1026
    poj3270
    poj3132
    poj3617
    poj3692
    从C#到Python —— 谈谈我学习Python一周来的体会
    使用Dreamweaver格式化HTML代码
  • 原文地址:https://www.cnblogs.com/chuancheng/p/9023643.html
Copyright © 2020-2023  润新知