zoukankan      html  css  js  c++  java
  • mysql插入中文报错

    java.sql.SQLException: Incorrect string value: 'xE7x88xB1xE6x99x92...' for column 'name_' at row 196

    类似这样的解决方案:

    更新的数据中有中文,出现如下错误:OperationalError at /admin/blog/post/add/(1366, "Incorrect string value: '\xE6\xB7\xB1\xE5\x85\xA5...' for column 'title' at row 1") POSThttp://localhost:8000/admin/blog/post/add/OperationalError(1366, "Incorrect string value: '\xE6\xB7\xB1\xE5\x85\xA5...' for column 'title' at row 1")C:Python25Libsite-packagesMySQLdbconnections.py in defaulterrorhandler, line 35
    类似这样的错误,应该是数据库表的charset和collation问题。尝试把所有表的charset改为utf-8, collation改为utf8-unicode-ci。如果还是不能解决,最好是重建数据库,然后修改数据库的属性,选择charset为utf-8,collation为utf8-unicode-ci。命令行:create database cc default charset utf8 collate utf8_unicode_ci;

  • 相关阅读:
    [Postman]历史(8)
    [Postman]响应(7)
    [Postman]请求(6)
    [Postman]查找替换(5)
    ORA-02050故障诊断一例
    转 js实践篇:例外处理Try{}catch(e){}
    转 PHP
    HTML DOM getElementById() 方法
    地点选择
    9i 和 11 g 区别
  • 原文地址:https://www.cnblogs.com/liuruichao/p/4005873.html
Copyright © 2011-2022 走看看