簡體   English   中英

在IIS上托管Wordpress時建立數據庫連接時出錯

[英]Error establishing a database connection while hosting Wordpress on IIS

當我使用Web Platform Installer安裝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-config中放入不同的東西。 / ** MySQL主機名* / define('DB_HOST','127.0.0.1');

它是Windows Server 2016,我不得不在注冊表中更改某些內容以成功安裝Wordpress,但我認為這不是問題因為現在安裝了wordpress。 但是,當我訪問http://example.com/blogging/wp-admin/install.php時,我收到上述錯誤。

更好的補充

define('WP_ALLOW_REPAIR', true);

在wp-config.php中嘗試修復數據庫連接。 有時使用localhost ip添加端口號將解決問題,請嘗試此操作

define('DB_HOST', '127.0.0.1:8889');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM