python 中文插入mysql报错

问题描述

python 中文插入mysql报错

哪位大神帮忙看看这个是什么问题? python 中文插入mysql报错:
content= [1165630L, '13940546367', 361L, None, Decimal('449.00'), Decimal('0.00'), 'xd5xd4xd4xa8xd5', 'xc1xc9xc4xfexcaxa1', 'xc9xf2xd1xf4xcaxd0', 'xbaxcdxc6xbdxc7xf8', 'xb6xfexbbxb7xd2xd4xc4xda', 'xb1xb1xc6xdfxc2xedxc2xb714-1xb3xc7xcaxd0xbcxd2xd4xb02-231' , 0, None, None, None, 'cancel', None, None, datetime.datetime(2014, 4, 21, 16, 50, 18), datetime.datetime(2014, 4, 22, 16, 50, 18), '210102', 1L, '59.46.115.218', 0, '5354dbc27a36b', None, 'pc', '1039175060', None, None, 0, 'midpage', None, None, '', 'BAIDUID=4BFEB25D0B44FB29C713EB0A281070EC%3AFG%3D1;PHPSESSID=g54k04ub8bj4etpdgkf0ne22n6;fr=ps-zhixin-weigou-b;psid=1465;frq=%E7%A2%A7%E6%AC%A7%E6%B3%89+%E7%94%B7%E5%A3%AB;qid=f31f0fd9000b8c54;', '4BFEB25D0B44FB29C713EB0A281070EC%3AFG%3D1', 'g54k04ub8bj4etpdgkf0ne22n6', 'ps-zhixin-weigou-b', '%E7%A2%A7%E6%AC%A7%E6%B3%89+%E7%94%B7%E5%A3%AB', 'f31f0fd9000b8c54', '1465'] len= 43

(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xc1xc9xc4xfexcaxa1','xc9xf2xd1xf4xcaxd0','xbaxcdxc6xbdxc7xf8','xb6xfexbbxb7xd2xd4xc4xda','xb1xb1xc6xdfxc2xedxc2xb714-1xb3xc7xcaxd0xbcxd2xd4xb02' at line 1")

解决方案

sql语法有问题,是不是转移字符的问题

时间: 2025-01-30 13:49:26

python 中文插入mysql报错的相关文章

java-用MySql插入图片报错!!r如何解决

问题描述 用MySql插入图片报错!!r如何解决 String sql="insert into image(tupian) values(?)"; Connection conn=null; PreparedStatement ps=null; try { conn=getConnection(); ps=(PreparedStatement) conn.prepareStatement(sql); ps.setBinaryStream(1, Thread.currentThread

numpy处理中文csv文件报错?

问题描述 numpy处理中文csv文件报错? #coding = gbk import numpy as np c,v,m=np.loadtxt('e:00718.csv', delimiter=',', usecols=(3,6,13),unpack=True) 其中,csv文件中第二列有中文字符,不管我设定coding是utf-8还是gbk,均报错.删除第二列,程序可以运行. 我修改000718.csv为utf格式,或另存为utf的txt格式,程序依然出错:猜测还是编码的问题,该如何解决,请

mysql 报错This function has none of DETERMINISTIC解决方案_Mysql

本文章向朋友们介绍开启bin-log日志mysql报错:This function has none of DETERMINISTIC, NO SQL解决办法, 创建存储过程时 出错信息: ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want t

PHP连接MySQL报错:SQLSTATE[HY000] [2002] Can t connect to local

如下所示,PHP连接MySQL报错: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'MySQL' (2) 测试代码如下: <?php try {  $dsn = 'mysql:dbname=php-note;host=localhost;port=3306;charset=utf8';  $username = 'root';  $password = 'root';  new PDO( $d

hibernate-关于clob插入mysql报如下错误

问题描述 关于clob插入mysql报如下错误 org.springframework.jdbc.UncategorizedSQLException: Hibernate flushing: could not update: [com.zte.ace.po.ApplicationAce#162304]; uncategorized SQLException for SQL [update application_ace set userId=?, usingName=?, version=?,

爬虫-python 2.7.6报错SyntaxError: invalid syntax

问题描述 python 2.7.6报错SyntaxError: invalid syntax 在学习爬虫的时候遇到了点问题: 'User-Agent':'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/34.0.1847.116 Chrome/34.0.1847.116 Safari/537.36' 这一行老是报错SyntaxError: invalid syntax hea

mysql案例:Java程序访问Mysql报错

mysql案例:Java程序访问Mysql报错'OPTION SQL_SELECT_LIMIT=XXX' [环境描述] mysql版本: 5.6.14-56-log Percona Server (GPL) 程序: 使用JDBC驱动mysql-connector-java访问mysql数据库 [报错信息] 程序访问mysql执行SQL语句的时候报错: You have an error in your SQL syntax; check the manual that corresponds t

hadoop-hive连接mysql 报错 readonly server

问题描述 hive连接mysql 报错 readonly server 各位大侠,我搭建了一个hadoop环境,用hive做数据仓库,mysql做hive的元数据仓库,用于定时分析用户数据中的日志文件,但在hive访问mysql的过程中,不定时的报如下错误: java.sql.SQLException: Query returned non-zero code: 1, cause: FAILED: Execution Error, return code 1 from org.apache.ha

gem-windous环境下 rails 连接mysql 报错

问题描述 windous环境下 rails 连接mysql 报错 用railsinstaller装的环境依赖的ruby rails devkit sqlite3都装过了现在想试试mysqlC:windowssystem32>rails new E:rubykk10 -d mysql Installing mysql2 (0.3.13)Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.