MySQL Forums
Forum List  »  Connector/Python

MariaDB: MySQL Connector/Python update fails for some string lengths
Posted by: Gabriel Voirol
Date: March 19, 2020 02:23AM

When updating a table entry, most strings work just fine but some don't. I assume it is related to the string length. For example, the strings "12345678" and "1234567890" work while the string "123456789" doesn't. Instead of correctly updating the entry, it throws a

OperationalError: 2055: Lost connection to MySQL server at '...:3306', system error: 60 Operation timed out

My script uses:

Python 3.7.6
mysql-connector-python 8.0.19

The db is running on the following system:

Server: Localhost via UNIX socket
Server type: MariaDB
Server connection: SSL is not being used Documentation
Server version: 10.4.12-MariaDB-1:10.4.12+maria~bionic - binary distribution
Protocol version: 10
Server charset: UTF-8 Unicode (utf8mb4)

Database client version: libmysql - mysqlnd 5.0.12-dev

Code that does not work:

mydb = mysql.connector.connect(...)
cursor = mydb.cursor()
cursor.execute('UPDATE table_1 SET name = "123456789" WHERE id = 1;')

Options: ReplyQuote

Written By
MariaDB: MySQL Connector/Python update fails for some string lengths
March 19, 2020 02:23AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.