错误建立一个数据库连接,而在IIS托管的WordPress

问题描述 投票:3回答:2

当我安装使用Web平台安装WordPress的我得到这个错误。

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 127.0.0.1. This could mean your host’s database server is down.

Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?

我可以成功安装的情况下,IIS和WordPress的文件夹是在同一台机器上。

但是,当我在IIS上安装WordPress和该应用程序指向疗法文件夹是一些网络,但是其他虚拟机上我得到这个错误。所以,很显然IIS看到该文件夹​​(其它非WordPress网站,ASP.NET是建立这样),但别的东西是问题。我试图把不同的东西WP-配置里面。 / ** MySQL主机* /定义( 'DB_HOST', '127.0.0.1');

它是Windows服务器2016年,我不得不改变一些东西在注册表中成功地安装WordPress的,但我不认为这是问题,因为WordPress是已经安装完毕。但是,当我访问http://example.com/blogging/wp-admin/install.php我得到上面提到的错误。

php mysql asp.net wordpress iis
2个回答
0
投票

最好加

define('WP_ALLOW_REPAIR', true);

在WP-config.php文件,并尝试修复你的数据库连接。有时,增加端口号与本地主机IP将解决这个问题,也请试试这个

define('DB_HOST', '127.0.0.1:8889');
© www.soinside.com 2019 - 2024. All rights reserved.