使用python-mysql连接到旧的mysql安装,

时间:2013-07-22 10:51:03

标签: python mysql python-2.7 mysql-python

我正在尝试连接到内置到物理设备中的数据库,我不想更改此mysql服务器的任何配置。

当我尝试连接时,我收到以下错误:

Traceback (most recent call last):
  File "connect3031.py", line 3, in <module>
    cnx = mysql.connector.connect(user='..', database='...', password='...', host='192.168.88.100')
  File "/usr/lib/pymodules/python2.7/mysql/connector/__init__.py", line 45, in Connect
    return MySQLConnection(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/mysql/connector/connection.py", line 366, in __init__
    self.connect(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/mysql/connector/connection.py", line 411, in connect
    ssl=(ssl_ca, ssl_cert, ssl_key))
  File "/usr/lib/pymodules/python2.7/mysql/connector/connection.py", line 449, in _open_connection
    self._charset)
  File "/usr/lib/pymodules/python2.7/mysql/connector/protocol.py", line 350, in do_auth
    "Authentication with old (insecure) passwords "\
mysql.connector.errors.NotSupportedError: Authentication with old (insecure) passwords is not supported: http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html

此问题的典型响应是,例如,mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication,但我不想触摸此服务器(除了选择数据),因此更新用户是不可能的。

我有什么办法可以配置客户端,所以它接受这些旧的不安全密码。我真的不关心安全性,因为它将通过VPN访问,并且所有密码基本上都是常识,因为它们印在手册中。

有问题的服务器是(无论如何mysqldump告诉我的是:

Server version       4.1.7-max

1 个答案:

答案 0 :(得分:3)

您可能需要使用其他连接器。

MySQL-python似乎支持MySQL3.23 +。

mysql-connector-python无法使用旧身份验证进行连接。