Getting "OperationalError: 1366" from python script - MySQL 5.6 . MySQLdb 1.2.3 -


environment:

  • mysql-python-1.2.3.win-amd64-py2.7

  • python-2.7.amd64

  • mysql-installer-community-5.6.12.2

  • windows server 2008 r2 datacenter

i getting operational error 1366 when inserting data python script. need run epfimporter 2010

i think problem mysqldb can handle uft8 not utf8mb4_unicode_ci. data need import contains utf8mb4 charackters , may not remove them.

running script cmd comand line gives me following error message after succesfully inserted ~70.000 rows:

2013-07-31 15:14:53,460 [error]: fatal error encountered while ingesting 'c:\webserver\www\site1\assets\scripts traceback (most recent call last):   file "c:\webserver\www\site1\assets\scripts\epfimporter\epfingester.py", line 129, in ingestfull     self._populatetable(self.tmptablename, skipkeyviolators=skipkeyviolators)   file "c:\webserver\www\site1\assets\scripts\epfimporter\epfingester.py", line 379, in _populatetable     cur.execute(exstr)   file "c:\windows\python\lib\site-packages\mysqldb\cursors.py", line 174, in execute     self.errorhandler(self, exc, value)   file "c:\windows\python\lib\site-packages\mysqldb\connections.py", line 36, in defaulterrorhandler     raise errorclass, errorvalue operationalerror: (1366, "incorrect string value: '\\xf0\\x9f\\x98\\x8a a...' column 'description' @ row 1") 

i allready made:

alter database databasexyz character set = utf8mb4 collate = utf8mb4_unicode_ci 

and changed following innodb to:

default storage engine  myisam  documentation default tmp storage engine  myisam  

before change not importing row @ all.

what else can do? should working since on shared host running on mysql server version: 5.5.28 , worked fine

edit1: testing installed latest xampp version , under xampp script running fine having xampp-mysql server running not apache. python , mysqldb versions remained same before , untouched. pretty sure did wrong in configuration of mysql-server. in xampp db running innodb engine.

here speccs of xampp mysql server:

server: 127.0.0.1 via tcp/ip server type: mysql server version: 5.6.11 - mysql community server (gpl) protocol version: 10 user: root@localhost server charset: utf-8 unicode (utf8) 

does has idea trace down problem in original mysql setup? in variable setting, mysql error handling or python connector?

i solved problem comparing xampp-mysql , regular mysql values in phpmyadmin > localhost > variables

i changed few values in regular mysql variables not 100% sure change solved issue guess changing to:

sql mode    no_engine_substitution 

i had few more other values strict_mode in there before deleted.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -