现象描述:
服务器启动MySQL8服务失败,报错mysqld[5304]: /usr/sbin/mysqld: error while loading shared libraries: libprotobuf-lite.so.3.19.4: cannot open sh
可能原因:
此台机器之前有lib64目录丢失的故障,虽然从其他机器拷贝了,但不确定此台机器之前安装的软件有没有依赖库在原来删掉的lib64。根据报错很有可能是这个原因
定位思路:
对比其他安装了同样MySQL版本的机器,找到报错提示的lib库
故障机器:
[root@localhost ~]# find /* -name 'libproto*'[root@localhost ~]#
其他完好机器:
[root@localhost ~]# find /* -name 'libproto*'/usr/lib64/mysql/private/libprotobuf-lite.so.3.19.4/usr/lib64/mysql/private/libprotobuf.so.3.19.4
发现完好机器上在/lib64目录下是有整个的mysql目录的,保险期间,将完好机器上的/usr/lib64/mysql打包,传输到故障机器上。
处理步骤:
完好机器:
[root@localhost lib64]# tar -zcvf mysql.tar.gz mysql/[root@localhost lib64]# mv mysql.tar.gz /root/[root@localhost lib64]# cd[root@localhost ~]# ll总用量 48M-rw-r--r--. 1 root root 48M 11月 16 17:36 mysql.tar.gz[root@localhost ~]# scp -r mysql.tar.gz root@192.168.137.14:/usr/lib64/The authenticity of host '192.168.137.14 (192.168.137.14)' can't be established.ED25519 key fingerprint is SHA256:s549mRQXqy05laDu+jYc7E1wPQohIV4Yool/thDzxjY.This key is not known by any other namesAre you sure you want to continue connecting (yes/no/[fingerprint])? t^HyesPlease type 'yes', 'no' or the fingerprint: yesWarning: Permanently added '192.168.137.14' (ED25519) to the list of known hosts.Authorized users only. All activities may be monitored and reported.root@192.168.137.14's password: mysql.tar.gz 100% 48MB 343.8MB/s 00:00
故障机器:
[root@localhost yum.repos.d]# cd /usr/lib64[root@localhost lib64]# tar xf mysql.tar.gz [root@localhost lib64]# rm -f mysql.tar.gz [root@localhost lib64]# ll mysql*lrwxrwxrwx 1 root root 25 9月 14 01:57 libmysqlclient.so.21 -> libmysqlclient.so.21.2.31-rwxr-xr-x 1 root root 7.3M 9月 14 02:09 libmysqlclient.so.21.2.31drwxr-xr-x 4 root root 4.0K 9月 14 01:57 mecabdrwxr-xr-x 2 root root 4.0K 11月 16 17:20 plugindrwxr-xr-x 3 root root 4.0K 11月 16 17:20 private
重启MySQL
[root@localhost ~]# systemctl restart mysqld[root@localhost ~]# systemctl status mysqld● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2022-11-16 17:46:50 CST; 4s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 5617 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 5640 (mysqld) Status: "Server is operational" Tasks: 39 (limit: 8745) Memory: 458.2M CGroup: /system.slice/mysqld.service └─5640 /usr/sbin/mysqld11月 16 17:46:49 localhost.localdomain systemd[1]: Starting MySQL Server...11月 16 17:46:50 localhost.localdomain systemd[1]: Started MySQL Server.
已恢复~!
参考信息:
无
来源地址:https://blog.csdn.net/weixin_44147924/article/details/127890021