SSL connection error with MySQLclient 2.2.5 using SQLAlchemy #739
Replies: 1 comment
-
Duplicate of #729. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Description
After upgrading the MySQLclient library to version 2.2.5, I am unable to connect to the database using SQLAlchemy due to an SSL error. This issue did not occur with the previous version, 2.2.4.
Steps to Reproduce:
Expected Behavior:
Successful connection to the database without SSL errors, as seen with version 2.2.4.
Actual Behavior:
Connection fails with an SSL error after upgrading to version 2.2.5.
Error
Traceback (most recent call last):
File "C:\Users\lorenzo.bonetti\AppData\Local\Programs\PyCharm Community 2\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "", line 1, in
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3278, in connect
return self._connection_cls(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\base.py", line 148, in init
Connection._handle_dbapi_exception_noconnection(
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2442, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3302, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 179, in _do_get
with util.safe_reraise():
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 177, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in init
self.__connect()
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect
with util.safe_reraise():
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect
self.dbapi_connection = connection = pool.invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\create.py", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\sqlalchemy\engine\default.py", line 621, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\MySQLdb_init.py", line 121, in Connect
return Connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Progetti\DataChat\new_venv\Lib\site-packages\MySQLdb\connections.py", line 195, in init
super().init(*args, **kwargs2)
sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (2026, 'TLS/SSL error: SSL is required, but the server does not support it')
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Environment
How did you install libmysqlclient libraries?
pip install mysqlclient
What version of mysqlclient do you use?
2.2.5
Docker command to start MySQL server
No response
Minimum but complete code to reproduce
Schema and initial data required to reproduce.
Commands, and any other step required to reproduce your issue.
No response
Beta Was this translation helpful? Give feedback.
All reactions