Pymysql connection inception, the value error problem occurs when judging the version.
The reason is that pymysql through '. ' Split, but the inception version information is like this
./mysql-v
Ver 14.14 Distrib Inception2.1.50, for Linux (x86_64) using Editline Wrapper
The version of Oracle MySQL is:
MySQL Ver 14.14 distrib 5.7.18, for Linux (x86_64) using Editline Wrapper
So Pymysql gets the value to Inception2, and the last int is quoted as value error.
You can simply modify the Pymysql connections.py (just to solve the problem, but not very familiar with the specific code)
def _request_authentication (self): # https://dev.mysql.com/doc/internals/en/connection-phase-packets.html# Packet-protocol::handshakeresponse if Self.server_version.split ('. ', 1) [0] = = ' Inception2 ': Self.client_ Flag |= CLIENT. Multi_results elif Int (self.server_version.split ('. ', 1) [0]) >= 5:self.client_flag |= client. Multi_results
;
Using the Pymysql connection configuration can be the following
conn = Pymysql.connect (host= ' 127.0.0.1 ', user= ', passwd= ', db= ', port=6669, Autocommit=true, cursorclass=pymysql.cursors.dictcursor, charset= ' u Tf8mb4 ')
Python 3 using Pymysql connection inception problem