处理了网站的一个错误

更新了系统以来,容器自动重启了,但是网站却打不开了。

提示:Error establishing a database connection.This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at 172.18.0.6 could not be established. This could mean your host’s database server is down.

大概意思就是数据库连不上了。

问了一下AI,很精准的定位了问题。

主要是容器重启后ip变化了,但是wp-config.php指向的还是原来的ip,所以就导致了无法连接数据库。得到如下启示:

1.wp配置文件指向的数据库最好以容器名字为准,这样可以避免ip变化带来的无法连接问题。

2.wp随时可能死掉,定期备份很重要。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注