问题描述:mysql在安装group_replication插件时,报错ERROR 1126"can't open share library xxxx group_replication.so",如下所示:
数据库:MySQL 8.0.27
系统:rhel 7.3
1、问题重现
mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';
ERROR 1126 (HY000): Can't open shared library '/usr/local/mysql/lib/plugin/group_replication.so' (errno: 11 /usr/local/mysql/lib/plugin/group_replication.so: cannot open shared object file: No such file or directory)
mysql> exit
Bye

2、解决过程
[mysql@leo-827mgr-master ~]$ ll /usr/local/mysql/lib/plugin/
ls: cannot access /usr/local/mysql/lib/plugin/: No such file or directory
[mysql@leo-827mgr-master ~]$ logout
[root@leo-827mgr-master ~]# find / -name "group_replication.so" 
/opt/mysql-8.0.27-linux-glibc2.17-x86_64-minimal/lib/plugin/group_replication.so

mysql> show variables like '%plugin%';
+-----------------------------------------------+------------------------------+
| Variable_name                                 | Value                        |
+-----------------------------------------------+------------------------------+
| default_authentication_plugin                 | mysql_native_password        |
| plugin_dir                                    | /usr/local/mysql/lib/plugin/ |
| replication_optimize_for_static_plugin_config | OFF                          |
+-----------------------------------------------+------------------------------+
3 rows in set (0.01 sec)

mysql> exit
Bye
[mysql@leo-827mgr-master local]$ logout
[root@leo-827mgr-master ~]# mkdir -p /usr/local/mysql/lib/plugin/
[root@leo-827mgr-master ~]# cp -p /opt/mysql-8.0.27-linux-glibc2.17-x86_64-minimal/lib/plugin/* /usr/local/mysql/lib/plugin/
cp: omitting directory ‘/opt/mysql-8.0.27-linux-glibc2.17-x86_64-minimal/lib/plugin/debug’
[root@leo-827mgr-master ~]# chown -R mysql:mysql /usr/local/mysql/
[root@leo-827mgr-master ~]# su - mysql
Last login: Mon Oct  2 16:43:52 CST 2023 on pts/0
[mysql@leo-827mgr-master ~]$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> install plugin group_replication soname 'group_replication.so';
Query OK, 0 rows affected (0.02 sec)

说明:如上所示,成功安装插件group_replication.so.