

























warning: 这篇文章距离上次修改已过1487天,其中的内容可能已经有所变动。
本文也算是一种解决 typecho 报 error establishing a database connection 的方法
以下正文
给 vps 新建 snapshot 做备份后重新启动机器,访问此站,看到如下页面

typecho 提示 error establishing a database connection
这很明显是 数据库连接没有建立起来,很可能是 mysqld 服务没有启。
重启了 mysqld 服务依然还是不行
systemctl restart mysqld
查看 mysqld 服务的状态
systemctl status mysqld
看到如下重要日志 Warning: World-writable config file '/etc/my.cnf' is ignored
Aug 19 21:44:32 sfo2 mysqld[1655]: Warning: World-writable config file '/etc/my.cnf' is ignored
Aug 19 21:44:32 sfo2 mysqld[1655]: Starting MySQL.Warning: World-writable config file '/etc/my.cnf' is ignored
Aug 19 21:44:32 sfo2 mysqld[1655]: Warning: World-writable config file '/etc/my.cnf' is ignored
Aug 19 21:44:34 sfo2 mysqld[1655]: . ERROR! The server quit without updating PID file (/www/server/mysql/data/sfo2.pid).
世界上任何人都可以写这个文件,说明该文件被赋予的权限太高?
ll 一下 果真是 777
[root@sfo2 ~]# ll /etc/my.cnf
-rwxrwxrwx 1 root root 1426 Dec 16 2019 /etc/my.cnf
改成 644 后 再重启机器 即可
[root@sfo2 ~]# chmod 644 /etc/my.cnf
[root@sfo2 ~]# reboot
重启后 查看 mysqld 状态的确是 active (running)
本文解决方法来自 mysql启动时,提示/etc/my.cnf 被忽略的问题处理 https://blog.csdn.net/yumushui/article/details/49124699
写本文主要是为了本人记录,end
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。