Some time ago I had tried to install MySQL workbench correctly on my system, and it was a tremendous headache. This is because I use Kubuntu with a very new version of Ubuntu Release, and I had a lot of problems. At some point (I don't know which one exactly) I must have done something that totally complicated my MySQL. I had to reinstall it again due to these problems, I reinstalled my MySQL and I can currently log into it smoothly through the CLI.
My MySQL runs on:
tcp6 0 0 :::33060 :::* LISTEN -
This is my code, it's pretty simple:
conexao = pymysql.connect(host="localhost", user='root', password='(pass)', database='sistema', port=33060)
But it generates this error:
Traceback (most recent call last):
File "/home/user/Documentos/SellBot/db.py", line 3, in <module>
conexao = pymysql.connect(host="localhost", user='root', password='(pass)', database='sistema', port=33060)
File "/home/user/Documentos/SellBot/venv/lib/python3.13/site-packages/pymysql/connections.py", line 365, in __init__
self.connect()
~~~~~~~~~~~~^^
File "/home/user/Documentos/SellBot/venv/lib/python3.13/site-packages/pymysql/connections.py", line 680, in connect
self._get_server_information()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/user/Documentos/SellBot/venv/lib/python3.13/site-packages/pymysql/connections.py", line 1109, in _get_server_information
self.server_thread_id = struct.unpack("<I", data[i : i + 4])
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 4 bytes
What is causing this error?
My Python version: Python 3.13.3
My PyMySQL version: PyMySQL==1.1.2
OS: Kubuntu x86_64
I can currently log into it smoothly through the CLI.please edit the question to demonstrate this - use a code block to show the args you use and the resultant prompt - your cli arguments may indicate the correct python args to use.