How to Customize, Modify or Change WordPress Database Connection Error Page如何自订,修改或改变的WordPress数据库连接错误页

When何时 WordPress在WordPress , a popular blog publishing platform built in PHP and uses MySQL database, cannot connect or having problem connecting to the database (such as when database is down), or the MySQL server has too many connections exceeding maximum connection allowed (especially when your post or article is been dugg on Digg.com) and rejects or denies new incoming connections, WordPress will display a default “error establishing database connection” error message page.一个流行的博客发布平台建于PHP和使用MySQL数据库,无法连接或有问题,连接数据库(例如当数据库) ,或MySQL服务器有太多的联系,超过最大允许连接(尤其是当您的帖子或文章是被dugg对digg.com ) ,拒绝或拒绝新的传入的连接,在WordPress会显示一个默认的“错误建立的数据库连接”的错误讯息页。 However, the WordPress error page, some is shown below, is not visitor friendly or user friendly, and worse, the default database error page also reveals the SQL server address and name.然而,在WordPress的错误网页,有些是如下图所示,是不是访问者的友好或用户友好,更糟的是,默认数据库的错误网页,也揭示了SQL Server的地址和名称。

Can’t select database不能选择数据库

We were able to connect to the database server (which means your username and password is okay) but not able to select the localhost database.我们可以连接到数据库服务器(即您的用户名和密码是好的) ,但无法选择本地数据库。

* Are you sure it exists? *您确定是否存在?
* On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. *在某些系统上的名称,您的数据库是前缀与您的用户名,所以会想username_wordpress 。 Could that be the problem?可这样的问题呢?

If you don’t know how to setup a database you should contact your host.如果您不知道如何安装一个数据库,您应该联系您的主机。 If all else fails you may find help at the WordPress Support Forums.如果这些方法都失败,你可能会发现帮助在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 localhost.这意味着,无论用户名和密码的信息在您的可湿性粉剂- config.php文件是不正确或我们不能接触数据库服务器在本地。 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?您确定该数据库服务器正在运行?

These default Wordpress database error pages are more meant for website administrators or webmasters rather than the public visitors.这些默认的WordPress数据库错误的页面更意味着网站管理员或网站管理员,而非市民参观。 However, you can change the error page to another different error page by modifying or altering wordings and text in the error page by customizing the wp-db.php file located in wp-include directory.不过,您可以变更错误页到另一个不同的错误网页通过修改或改变措辞和案文中的错误网页通过自定义可湿性粉剂- db.php文件设在可湿性粉剂-包括目录。 Here’s how you can hack the Wordpress default error message.这里的如何,您可以入侵该WordPress所预设的错误讯息。

In wp-db.php (the file that handles the database connections that WordPress makes), you can see lines like “DB Constructor - connects to the server and selects a database” and “Select a DB (if another one needs to be selected)”.在可湿性粉剂- db.php (文件处理数据库连接的WordPress令) ,您可以看到如“分贝构造-连接到服务器,并选择一个数据库”和“选择一个分贝(如果另一项需要加以选定) “ 。 That’s where you can alter the text and word in the error page.说的,您可以改变文字和字的错误页。 Just look carefully after the line, you will see exactly the some text and message as appeared on the database error page.刚才仔细考虑后线,您会看到,正是一些文字和讯息出现在数据库错误页。 Edit them to your liking.编辑您想要的。

在WordPress保释功能
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”.旁边,从线312起是页眉和页脚输出的HTML数据库连接错误页,里面包含的功能命名为“保释” ,其中订明的东西,像“称号的WordPress :错误” 。 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. “保释”功能是所谓每当一个数据库连接错误是遇到的,和做什么,它的名字所说的话-b ails出错误,并显示错误讯息,而是要通知用户。 You can change them if you like too.您可以改变他们如果你喜欢太。

Please take a backup of wp-db.php file before you customize or alter it.请采取的备份可湿性粉剂- db.php文件之前,您可以自定义或改变它。 If you break the code, your website visitors and surfers will get the PHP error instead.如果您打破代码,您的网站访问者和冲浪者将获得PHP的错误信息。 Beside, be careful that when you upgrade your WordPress.旁边,小心,当您升级您的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.如果您覆盖所有文件时,提升的WordPress ,可湿性粉剂- db.php将取代回到与原来的版本不变,也和你必须编辑该文件再次。 Else, backup the wp-db.php before upgrading your WordPress and restore it after upgrading is done.否则,备份可湿性粉剂- db.php升级前您的WordPress和恢复它升级后是这样做。

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 我的数字生活论坛 .



Leave a Reply离开的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用这些标签:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <删除日期时间= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting订阅无评论


Custom Search

New Articles新的条款,

Incoming Search Terms for the Article传入的搜索条件文章

wordpress database connection 在WordPress的数据库连接 - - Error establishing a database connection wordpress 错误建立一个数据库连接的WordPress - - change wordpress database 改变的WordPress数据库 - - wordpress mu error establishing a database connection 在WordPress万亩错误建立一个数据库连接 - - Error establishing a database connection 错误建立一个数据库连接 - - wordpress Error establishing a database connection 在WordPress错误建立一个数据库连接 - - wordpress database connection details 在WordPress的数据库连接细节 - - wordpress change database 在WordPress改变数据库 - - wordpress change database password 在WordPress改变数据库密码 - - WordPress "Error establishing a database connection" 在WordPress “的错误建立一个数据库连接” - - wordpress 2.6 Error establishing a database connection 在WordPress 2.6错误建立一个数据库连接 - - how to change wordpress database 如何改变的WordPress数据库 - - wordpress change database connection WordPress所改变的数据库连接 - - wordpress database connect 在WordPress数据库的连接 - - wordpress database setting 在WordPress数据库设置 - - wordpress change database user password 在WordPress改变数据库的用户密码 - - wordpress DB connection 在WordPress DB连接 - - php connect to wordpress database PHP的连接到数据库的WordPress - - Error establishing a database connection MU 错误建立一个数据库连接万亩 - - error establishing database connection wordpress 错误建立数据库连接的WordPress - - modify wordpress database error page 修改的WordPress数据库错误页 - - modify wordpress database 修改的WordPress数据库 - - wordpress change username WordPress所改变的用户名 - - wordpress 2.6 "Error establishing a database connection" 在WordPress 2.6 “的错误建立一个数据库连接” - - Error establishing a database connection wordpress MU 错误建立一个数据库连接的WordPress万亩 - - wordpress connect to database 在WordPress连接到数据库 - - wordpress db password 在WordPress分贝密码 - - "connection setup" "error in the database" “连线设定” , “错误在数据库中” - - connect wordpress database 连接的WordPress数据库 - - Error establishing a database connection on wordpress 错误建立一个数据库连接上的WordPress - - Error establishing a database connection+wordpress 错误建立一个数据库连接+在WordPress - - wordpress change database information WordPress所改变的数据库信息 - - connecting to wordpress database 连接到数据库的WordPress - - change user-name db 改变用户的名称分贝 - - customize "error establishing a database connection" screen 自定义“的错误建立一个数据库连接”屏幕 - - wordpress change database connections 在WordPress改变数据库连接 - - change database wordpress 改变数据库的WordPress - - how to change wordpress database password 如何改变的WordPress数据库密码 - - Can’t select database wordpress 不能选择数据库的WordPress - - Wordpress "SQL Server" MySQL 在WordPress的“ SQL Server ”的MySQL - - wordpress move "error establishing a database connection" 在WordPress动议“的错误建立一个数据库连接” - - wordpress default db password WordPress所预设的分贝密码 - - wordpress display database WordPress所显示的数据库 - - wordpress database connector 在WordPress数据库连接器 - - "error establishing a database connection" yahoo hosting “的错误建立一个数据库连接”雅虎主办 - - Custom WordPress Error establishing a database connection 自定义的WordPress错误建立一个数据库连接 - - wordpress change database server WordPress所改变的数据库服务器 - - wordpress global translator max connection to database 在WordPress翻译全球最大的连接数据库 - - wordpress database remote host 在WordPress数据库远程主机 - - how to customize wordpress default error pages 如何自订的WordPress默认的错误页面 - -