在尝试安装 wordpress 时我收到以下错误
我使用 wampserver 我已经更改了 wp-config.php 文件,现在它看起来像这样:
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', 'root');
/** MySQL hostname */
define('DB_HOST', 'localhost');//i used 127.0.0.1 too but no matter
define('WP_DEBUG', true);
wp-db.php 文件: 1379行:
mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
1409行:
$this->dbh = mysqli_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
但仍然没有结果我不知道该怎么办有人可以帮助我吗?
最佳答案
如果您使用的是 xampp/wamp 的默认配置,请尝试
define('DB_PASSWORD', '');//对于本地主机
通常是本地主机数据库配置:-
host = localhost
user = root
password = '' (blank)
关于php - 建立数据库连接时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27010062/