Ubuntu强制重启后MySQL不能启动 Scheduled restart job, restart counter is at 5.
短信预约 -IT技能 免费直播动态提醒
/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 .成功了.
记录一下便于下次用,也供大家借鉴.
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341