cpanel - Cannot make remote connection with PyMySQL (pymysql.err.InternalError: Packet sequence number wrong) -


update: problem solved, solution posted below

i new process of making remote database connections, seems there tends not obvious solution error.

pymysql.err.internalerror: packet sequence number wrong - got 80 expected 0 arises when attempting make following pymysql connection

i'm running macos 10.12.5, python 2.7.10 in pycharm (also tried terminal), , pymysql 0.7.11 (also tried 0.7.9)

update: tried on windows 10, python 2.7.13 same result

the database hosted on cpanel. perhaps there additional settings change before can connect. connecting user has full privileges. ip added host "access" list.

other notes: might expected, if port number or host ip randomly changed, refuses connection. otherwise, takes 30 seconds before 'packet sequence' error arise.

import pymysql.cursors import pymysql  connection = pymysql.connect(host = hostipaddress,                              port = 2083,                              user = username,                              passwd = password,                              db = dbname,                              charset = 'utf8mb4', # tried 'utf8'                              cursorclass=pymysql.cursors.dictcursor) 

while port 2083 used host, each database uses default port 3306 in case.

when tested 3306, access denied until added denied ip host "access" list in remote mysql on cpanel.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -