如何定做,修改或改變WordPress數據庫連接錯誤頁
當 WordPress在PHP建立的一個普遍的blog出版的平臺和用途MySQL數據庫,不可能連接或有問題連接到數據庫(例如,當數據庫下降)時,或者MySQL服務器有許多連接超出允許的最大連接(特別是當您的崗位或文章是dugg在Digg.com)時并且拒绝或者否認新的傳入連接, WordPress將顯示缺省「建立數據庫連接的錯誤」錯誤信息頁。 然而, WordPress錯誤頁,一些如下所示,不是訪客友好或用戶友好,并且更壞,缺省數據庫錯誤頁也顯露SQL服務器地址和名字。
不能選擇數據庫
我們能連接到意味的數據庫服務器(您的用戶名和密碼是好的),但不能選擇localhost數據庫。
*您是否是肯定的它存在?
*在有些系統您的數據庫的名字加前綴與您的用戶名,因此它是像username_wordpress。 那能是問題?如果您不會設定數據庫您應該與您的主人聯繫。 如果所有發生故障您可以發現幫助在WordPress支持論壇。
建立數據庫連接的錯誤
這二者之一意味著用戶名和口令信息在您的wpconfig.php文件是不正確的或我們不可能與數據庫服務器聯繫在localhost。 這可能意味您的主人的數據庫服務器是下來。
您是否是肯定的您有正確用戶名和密碼?
您是否是肯定的您鍵入了正確主機名?
您是否是肯定的數據庫服務器運行?
這些缺省Wordpress數據庫錯誤頁為網站管理員或Web站點管理員而不是公開訪客更意味。 然而,您能改變錯誤頁到另一另外錯誤頁通過修改或改變wordings和文本在錯誤頁通過定做尋找的wpdb.php文件wp包括目錄。 這怎麼您能亂砍Wordpress缺省錯誤信息。
在處理數據庫連接WordPress牌子)的wpdb.php (文件,您能看線像「DB建設者-連接到服務器并且選擇數據庫」,并且「選擇DB (如果另一個需要被選擇)」。 那是您在錯誤頁的地方能修改文本和詞。 請在線以後仔細地看,您在數據庫錯誤頁將確切地看某一文本和消息如出現。 編輯他們到您喜歡。

Beside, from line 312 onwards is the header and footer output for the HTML of database connection error page, contains inside function named “bail”, which specifies things like the title of “WordPress: Error”. The “bail” function is called whenever a database connection error is encountered, and does what it’s name said - bails out the error and displays an error message instead to notify the users. You can change them if you like too.
Please take a backup of wp-db.php file before you customize or alter it. If you break the code, your website visitors and surfers will get the PHP error instead. Beside, be careful that when you upgrade your WordPress. If you overwrite all files when upgrade the WordPress, the wp-db.php will be replaced back with the original unchanged version too, and you have to edit the file again. Else, backup the wp-db.php before upgrading your WordPress and restore it after upgrading is done.
IMPORTANT: This is a machine translated page which is provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Using PHP-MySQL Persistent Connections to Run WordPress Blog
- How to Change the Frequency or Interval WordPress Auto Saves An Editing Post or Page
- WordPress MySQL SQL Query Error in WPDB Class
- How to Move WordPress Blog to New Domain or Location
- PHP Allowed Memory Size Exchausted Fatal Error
- Disable and Turn Off Post Revisions Tracking in WordPress 2.6 or Above
- WordPress Charset Encoding Problem After Upgrading to Version 2.2
- Incorporate and Integrate Amazon aStore with Wordpress Page
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working
- WordPress 2.1.1 Critical Security Alert - Download Upgrade to 2.1.2




























