2

I was using the connection to the remote Mariadb server for months. Today the connection couldn't be established anymore via the python mariadb module and the mariadb connector on macOS. The basic installation is as follows:

brew install mariadb-connector-c
pip install mariadb

To connect to the server via python:

>>> import mariadb
>>> mariadb.connect(host="<IP>", port=3306)

The return is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/<name>/miniconda3/lib/python3.8/site-packages/mariadb/__init__.py", line 142, in connect
    connection = connectionclass(*args, **kwargs)
  File "/Users/<name>/miniconda3/lib/python3.8/site-packages/mariadb/connections.py", line 83, in __init__
    super().__init__(*args, **kwargs)
mariadb.OperationalError: Can't connect to server on '<IP>' (60)

I can connect to the MariaDB server via the terminal mysql client (mysql -h ) as well as establish a connection using the telnet module:

>>> import telnetlib 
>>> telnetlib.Telnet(host="<IP>", port=3306)

I also can connect to a locally installed mariadb server via python and the mariadb module. Remote throws the above error though.

Anyone an idea why the connection can't be established?

4
  • Which versions of mariadb-connector-c and mariadb (python connector)?
    – danblack
    Commented Aug 31, 2022 at 4:39
  • python connector (Mariadb): 1.1.4 mariadb-connector-c: 3.3.2 (I updated today to see if it fixes anything)
    – doom4
    Commented Aug 31, 2022 at 4:48
  • I found an old installation of mariadb-connector-c: 3.3.1 and installed python connector (Mariadb): 1.0.11 and this works now. Maybe there is a bug in 3.3.2?
    – doom4
    Commented Aug 31, 2022 at 14:41
  • 1
    Reported this issue here: mariadb.com/kb/en/…
    – doom4
    Commented Aug 31, 2022 at 20:45

1 Answer 1

2

It's a bug which was introduced by a fix for CONC-607 (PR-204, commit dfe3563192e43a48bef3a861e72d9d122b9b346c). To track this issue please check CONC-612 on MariaDB Issue tracker.

Update (2022-09-02 10:07 CEST): Issue is fixed (Connector/C 3.1.19 and 3.3.4)

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.