Ubuntu 上的 Apache2,没有 SELinux。
我正在尝试安装 WordPress 的新服务器,但出现错误
cannot connect to database
我可以使用命令行登录
mysql -u user -p database
很好,端口 3306 是活的。
root@localhost:/home/www/services.com# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::80 :::* LISTEN
root@localhost:/home/www/services.com# cat wp-config.php
root@localhost:/home/www/services.com# ufw 状态
Status: inactive
完整错误:
Warning: mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in /home/www/services.com/wp-includes/wp-db.php on line 1633
Warning: mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client in /home/www/services.com/wp-includes/wp-db.php on line 1633
The server requested authentication method unknown to the client
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
我还检查了用户名中的空格或错误,并阅读了许多其他类似的帖子。
如何让 WordPress 连接到 MySQL?
慕尼黑5688855