Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
1.0.4
-
None
-
MariaDB 10.5
Python 3.6
CentOS 7.8
Description
When migrating from the mysql to the mariadb connector, I found out, that when using the socket user identification from 10.5 the password is not ignored.
So an extra if block is needed to connect to the server.
using the mysql connector, this code will work:
db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path,database="mysql") |
But for the mariadb connector it must changed to:
if root_pw: |
db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path, database="mysql") |
else: |
db_connection = db_connector.connect(user="root",unix_socket=socket_path, database="mysql") |
When connect via socket auth, the password will be None, because it is not needed. But the mariadb python module can't handle it. The connect will fail with:
TypeError: connect() argument 4 must be str, not None
|