[英]MariaDB connector in Python cannot connect to remote server
I was using the connection to the remote Mariadb server for months.几个月来,我一直在使用与远程 Mariadb 服务器的连接。 Today the connection couldn't be established anymore via the python mariadb module and the mariadb connector on macOS.
今天,无法再通过 macOS 上的 python mariadb 模块和 mariadb 连接器建立连接。 The basic installation is as follows:
基本安装如下:
brew install mariadb-connector-c
pip install mariadb
To connect to the server via python:通过 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:我可以通过终端 mysql 客户端(mysql -h)连接到 MariaDB 服务器,并使用 telnet 模块建立连接:
>>> import telnetlib
>>> telnetlib.Telnet(host="<IP>", port=3306)
I also can connect to a locally installed mariadb server via python and the mariadb module.我还可以通过 python 和 mariadb 模块连接到本地安装的 mariadb 服务器。 Remote throws the above error though.
远程虽然抛出上述错误。
Anyone an idea why the connection can't be established?有人知道为什么无法建立连接吗?
It's a bug which was introduced by a fix for CONC-607 (PR-204, commit dfe3563192e43a48bef3a861e72d9d122b9b346c).这是一个由 CONC-607 的修复程序引入的错误(PR-204,提交 dfe3563192e43a48bef3a861e72d9d122b9b346c)。 To track this issue please check CONC-612 on MariaDB Issue tracker.
要跟踪此问题,请检查 MariaDB 问题跟踪器上的 CONC-612 。
Update (2022-09-02 10:07 CEST) : Issue is fixed (Connector/C 3.1.19 and 3.3.4)更新(2022-09-02 10:07 CEST) :问题已修复(连接器/C 3.1.19 和 3.3.4)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.