我可以在 Amazon Linux 2 上安装 MySQL ODBC Driver 8 吗?

问题描述 投票:0回答:1

我在使用

pyodbc
mysql-connector-odbc
驱动程序连接到 Amazon Linux 2 上的 MySQL 数据库时遇到问题。如下图:

pyodbc.OperationalError: ('08004', "[08004] [unixODBC][MySQL][ODBC 5.2(w) Driver]Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory (2059) (SQLDriverConnect)")

我尝试将我的 Amazon Linux 版本升级到

2.0.20230207.0
,但得到了类似的错误:

pyodbc.OperationalError: ('08004', "[08004] [unixODBC][MySQL][ODBC 5.2(w) Driver]Authentication plugin 'sha256_password' cannot be loaded: /usr/lib64/mysql/plugin/sha256_password.so: cannot open shared object file: No such file or directory (2059) (SQLDriverConnect)")

我的理解是这是因为 MySQL 服务器的版本使用的版本比我的 ODBC 驱动程序支持的版本更新。我很想升级 ODBC 驱动程序以验证这是原因,但似乎 Amazon Linux 只支持

mysql-connector-odbc-5.2.5
,但最新版本是
8.0.32
。有什么方法可以手动安装更新版本的 MySQL ODBC 驱动程序,还是 Amazon Linux 2 无法安装?

提前致谢!

mysql pyodbc unixodbc amazon-linux
1个回答
0
投票

我认为您需要为 mysql 服务器创建用户和密码

ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

参考:https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html

© www.soinside.com 2019 - 2024. All rights reserved.