处理mysql报错: Can't open shared library 和 No paths allowed for shared library

安装mysql插件rpl_semi_sync_master时报如下异常:
mysql> INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
ERROR 1126 (HY000): Can't open shared library '/usr/lib64/mysql/plugin/semisync_master.so' (errno: 2 /usr/lib64/mysql/plugin/semisync_master.so: cannot open shared object file: No such file or directory)
指定正确路径则报:
mysql> INSTALL PLUGIN rpl_semi_sync_master SONAME '/data/mysql/usr/lib64/mysql/plugin/debug/semisync_master.so';
ERROR 1124 (HY000): No paths allowed for shared library
mysql是用非root用户安装的,安装路径为:  /data/mysq,需要确认
basedir和plugin_dir的信息:
mysql> select @@basedir;
+-----------+
| @@basedir |
+-----------+
| /usr/     |
mysql> show variables like "plugin_dir";
+-------------------------------+--------------------------+
| Variable_name                 | Value                    |
+-------------------------------+--------------------------+
| plugin_dir                    | /usr/lib64/mysql/plugin/ |
+-------------------------------+--------------------------+
由上可知,默认路径不正确,需要更正,在my.cnf #添加正确的basedir和plugin_dir

[dongzw@localhost data]$ vi /data/mysql/etc/my.cnf #添加
basedir=/data/mysql
plugin_dir=/data/mysql/usr/lib64/mysql/plugin

----------------重起mysql------------

mysql> select @@basedir;
+--------------+
| @@basedir    |
+--------------+
| /data/mysql/ |
+--------------+
1 row in set (0.00 sec)

mysql> show global variables like 'plugin_dir' ;
+---------------+-------------------------------------+
| Variable_name | Value                               |
+---------------+-------------------------------------+
| plugin_dir    | /data/mysql/usr/lib64/mysql/plugin/ |
+---------------+-------------------------------------+
1 row in set (0.00 sec)

再次检查以上变量值为正确,查看已安装插件:
mysql> show plugins;
binlog                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| mysql_native_password      | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| sha256_password            | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| CSV                        | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| MEMORY                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| InnoDB                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |

再次安装插件
mysql> install plugin rpl_semi_sync_master soname 'semisync_master.so';
Query OK, 0 rows affected (0.02 sec)

mysql> install plugin rpl_semi_sync_slave soname 'semisync_slave.so';
Query OK, 0 rows affected (0.00 sec)
mysql> show plugins;
| rpl_semi_sync_master       | ACTIVE   | REPLICATION        | semisync_master.so | GPL     |
| rpl_semi_sync_slave        | ACTIVE   | REPLICATION        | semisync_slave.so  | GPL     |

问题解决。
 

Iperf3 is a network traffic analysis and testing tool used to measure the bandwidth and latency between two hosts. When you encounter an error like "iperf3: error while loading shared libraries: libiperf.so.0: cannot open shared object file: No such file or directory," it typically indicates that the Iperf3 library (libiperf.so.0) cannot be found on your system. This error usually happens when: 1. The library is missing from the current execution environment, which could happen if you haven't installed Iperf3 properly or the package is not compatible with your system version. 2. The library path is not set correctly in your system's dynamic linker search paths, so the operating system can't locate the library at runtime. To resolve this issue, follow these steps: - **Update or reinstall Iperf3**: Check if there's a newer version available for your system and install it, making sure to include all necessary dependencies. - **Check installation**: Verify if the package was installed correctly by running `whereis iperf3` or `which iperf3` to see if it points to the correct location. - **Set library path**: If the library is installed but still not found, try adding the directory containing the library to your `LD_LIBRARY_PATH` or edit your shell's configuration to include the path permanently. - **Manually locate the library**: Search your system for the missing library file (e.g., `/usr/lib/` or `/usr/local/lib/`) and symlink it to a location where it can be found. After trying these steps, you should be able to run iperf3 without errors.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值