数据库
首页 > 数据库> > 使用python-mysql连接到旧版mysql安装,

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

作者:互联网

我正在尝试连接到内置于物理设备中的数据库,并且我不想更改此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

解决方法:

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

MySQL-python似乎支持MySQL3.23.

mysql-connector-python根本无法使用旧的身份验证进行连接.

标签:python-2-7,mysql-python,python,mysql
来源: https://codeday.me/bug/20191123/2064254.html