无法加载身份验证插件“mysql_native_password”:/usr/lib/mysql/plugin/mysql_native_password.so:无法打开共享对象文件

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

我尝试执行genomepy来安装生物基因组数据,但该软件引发了与mysql客户端相关的异常,如下所示。

_mysql_connector.MySQLInterfaceError: Authentication plugin 'mysql_native_password' cannot be loaded: /usr/lib/mysql/plugin/mysql_native_password.so: cannot open shared object file: No such file or directory

我正在运行 Debian 12 操作系统。

Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

我已经使用下面的命令安装了mysql-client。

apt-get install default-mysql-client

当我执行下面的命令时。

genomepy install xenTro9 --UCSC-annotation refGene

我得到下面的输出。

(base) root@567b7019ab11:/local/data/nf_genome_annot_backend# date;time genomepy install xenTro9 --UCSC-annotation refGene;date;
Sun Dec 22 08:32:37 UTC 2024
08:32:41 | INFO | Downloading the refGene annotation from the UCSC MySQL database.
Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.12/site-packages/mysql/connector/connection_cext.py", line 327, in _open_connection
    self._cmysql.connect(**cnx_kwargs)
_mysql_connector.MySQLInterfaceError: Authentication plugin 'mysql_native_password' cannot be loaded: /usr/lib/mysql/plugin/mysql_native_password.so: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.12/site-packages/genomepy/providers/ucsc.py", line 343, in download_annotation
    download_annotation(name, annot, genomes_dir, localname)
  File "/usr/local/anaconda3/lib/python3.12/site-packages/genomepy/providers/ucsc.py", line 560, in download_annotation
    cols = list(query_ucsc(command, database=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bioinformatics biopython libmysqlclient
1个回答
0
投票

你可以尝试这个,因为它应该有所需的插件

sudo apt-get install mysql-server 

找到 MySQL 插件目录:找到存储 MySQL 插件的目录....通常是

/usr/lib/mysql/plugin OR /usr/lib/x86_64-linux-gnu/mariadb19.0/plugin/

验证插件文件,检查插件目录下是否存在mysql_native_password.so文件。如果没有,您可能需要重新安装 MySQL 服务器。

查看 Python 的 MySQL 连接器是否已正确配置为使用本机密码插件。

设置默认身份验证插件:将以下行添加到您的 MySQL 配置文件中

/etc/mysql/my.cnf or /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
default_authentication_plugin=mysql_native_password

更改配置后,重新启动 MySQL 服务器:

sudo service mysql restart

重新安装适用于 Python 的 MySQL 连接器

pip uninstall mysql-connector-python
pip install mysql-connector-python

然后再次尝试genomepy安装命令..

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