WordPress无法连接到MySQL服务器 [英] Wordpress cannot connect to mysql server
问题描述
我已经在Macbook中运行了mysql服务器,可以在其中通过mysql命令mysql -u root
和navicat应用程序进行访问.但是,当我在Macbook中打开一个全新的wordpress应用的安装页面时.在安装过程中,我得到了:
I have run a mysql server in my macbook, where I can access via both mysql command mysql -u root
and navicat application. However, when I open the install page of a brand new wordpress app in my macbook. During the installation, I had got:
推荐答案
MySQL 8.x实际上受支持,但是在创建用户和密码时需要稍有不同的命令,因为版本8期望密码是SHA256编码的.
MySQL 8.x actually IS supported, but requires a slightly different command when creating the user and password, as version 8 expects passwords to be SHA256 encoded.
在创建数据库用户时,在MySQL提示符下,使用以下命令:
When creating the database user, with the MySQL prompt, use the following:
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
所以与mysql_native_password 是主要区别.祝你好运!
So WITH mysql_native_password being the main difference. Good luck!
这篇关于WordPress无法连接到MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!