当前位置:   article > 正文

Ubuntu强制重启后MySQL不能启动 Scheduled restart job, restart counter is at 5.

scheduled restart job, restart counter is at 5

/usr/sbin/mysqld: error while loading shared libraries: libprotobuf-lite.so.3.19.4: cannot open shared object file: No such file or directory


天翼云上面的服务器是Ubuntu20.04,因为设备配置变更,客服变更后密码莫名不对了,实在无奈强制关机后改了密码.
再次启动服务器后,发现自动启动的服务没有启动.检查进程发现mysql没有启动,对应的平台进程也没有启动.
那么发现是mysql没有启动造成的,先去/var/log/syslog里面找一下 日志.
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 systemd[1]: mysql.service: Main process exited, code=exited, status=127/n/a
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 systemd[1]: mysql.service: Failed with result ‘exit-code’.
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 systemd[1]: Failed to start MySQL Community Server.
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 4.
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 systemd[1]: Stopped MySQL Community Server.
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 systemd[1]: Starting MySQL Community Server…
Feb 24 03:01:08 master-yzjgxh2578346419-1667378623792 mysqld[2846]: /usr/sbin/mysqld: error while loading shared libraries: libprotobuf-lite.so.3.19.4: cannot open shared object file: No such file or directory
发现无法加载libprotobuf-lite.so.3.19.4.
遂定位到/usr/lib/mysql/private/目录发现文件有,但是没有权限.
授权之,启动mysql发现还是无法启动,还是报相同错误.
无意中发现/usr/lib/mysql 没有权限,chmod -R 777 /usr/lib/mysql
提示
root@master-yzjgxh2578346419-1667378623792:/usr/lib# chmod -R 777 mysql
chmod: changing permissions of ‘mysql/plugin’: Operation not permitted
chmod: changing permissions of ‘mysql/zlib_decompress’: Operation not permitted
chmod: changing permissions of ‘mysql/private’: Operation not permitted
先解决这个权限问题吧 需要用到chmod的底层命令
lsattr /usr/lib/mysql/
结果
root@master-yzjgxh2578346419-1667378623792:/usr/lib# lsattr /usr/lib/mysql/
----i---------e----- /usr/lib/mysql/plugin
----i---------e----- /usr/lib/mysql/zlib_decompress
----i---------e----- /usr/lib/mysql/private
说明文件夹被锁了
执行chattr -i /usr/lib/mysql/
再chmod -R 777 /usr/lib/mysql 权限只是没时间去搞了全开放吧
启动mysql 还报相同错误, 怎么办?
后面想到这是64位系统, cp /usr/lib/mysql /usr/lib64/mysql
再次启动mysql .成功了.

记录一下便于下次用,也供大家借鉴.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/187871
推荐阅读
相关标签
  

闽ICP备14008679号