pymysql: Packet sequence number wrong - got 1 expected 0

Installation und Anwendung von Datenbankschnittstellen wie SQLite, PostgreSQL, MariaDB/MySQL, der DB-API 2.0 und sonstigen Datenbanksystemen.
Antworten
earloop
User
Beiträge: 42
Registriert: Sonntag 11. Oktober 2020, 13:54

Hi,

das Aufbauen einer DB-Verbindung (MariaDB) per pymysql funktioniert nur wenn ich als host = localhost angebe.
Also, das funktioniert:

Code: Alles auswählen

import pymysql

connection = pymysql.connect(host='localhost',
                             user='USERNAME',
                             password='PASSWORD',
                             db='DBNAME'
                             )
Das nicht:

Code: Alles auswählen

import pymysql

connection = pymysql.connect(host='192.168...',
                             user='USERNAME',
                             password='PASSWORD',
                             db='DBNAME'
                             )
Fehlermeldung:

Code: Alles auswählen

Traceback (most recent call last):
  File "/home/earloop/test.py", line 15, in <module>
    db='Test'
  File "/usr/local/lib/python3.7/dist-packages/pymysql/connections.py", line 353, in __init__
    self.connect()
  File "/usr/local/lib/python3.7/dist-packages/pymysql/connections.py", line 632, in connect
    self._get_server_information()
  File "/usr/local/lib/python3.7/dist-packages/pymysql/connections.py", line 1055, in _get_server_information
    packet = self._read_packet()
  File "/usr/local/lib/python3.7/dist-packages/pymysql/connections.py", line 707, in _read_packet
    % (packet_number, self._next_seq_id)
pymysql.err.InternalError: Packet sequence number wrong - got 1 expected 0
Benutzeravatar
__blackjack__
User
Beiträge: 14336
Registriert: Samstag 2. Juni 2018, 10:21
Wohnort: 127.0.0.1
Kontaktdaten:

@earloop: Ein `InternalError` ist wohl eher ein Fall für die Entwickler von `PyMySQL`.
„Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.“ — Brian W. Kernighan
Antworten