How to Customize, Modify or Change WordPress Database Connection Error Page Làm thế nào để Customize, Chỉnh sửa hoặc thay đổi kết nối WordPress Cơ sở dữ liệu Lỗi Trang

When Khi 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. , Một blog xuất bản nền tảng phổ biến trong PHP được xây dựng và sử dụng cơ sở dữ liệu MySQL, không thể kết nối hoặc có vấn đề kết nối với cơ sở dữ liệu (chẳng hạn như khi cơ sở dữ liệu là xuống), hoặc máy chủ MySQL đã kết nối quá nhiều quá kết nối tối đa cho phép (đặc biệt là khi đăng bài của bạn hoặc Bài viết là được Dugg trên Digg.com) và từ chối hoặc từ chối các kết nối mới đến, WordPress sẽ hiển thị mặc định "lỗi thiết lập kết nối cơ sở dữ liệu" báo lỗi trang. 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. Tuy nhiên, lỗi trang WordPress, một số được hiển thị dưới đây, không phải là thân thiện với người truy cập hoặc người dùng thân thiện, và tệ hơn, các cơ sở dữ liệu trang mặc định lỗi cũng cho thấy địa chỉ máy chủ SQL và tên.

Can't select database Không thể lựa chọn cơ sở dữ liệu

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. Chúng tôi đã có thể kết nối với máy chủ cơ sở dữ liệu (có nghĩa là tên người dùng và mật khẩu của bạn không quan trọng) nhưng không thể chọn các cơ sở dữ liệu localhost.

* Are you sure it exists? * Bạn có chắc là nó tồn tại?
* On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. * Trên một số hệ thống tên của cơ sở dữ liệu của bạn là tiền tố với tên đăng nhập của bạn, do đó, nó sẽ như username_wordpress. Could that be the problem? Mà có thể được vấn đề?

If you don't know how to setup a database you should contact your host. Nếu bạn không biết làm thế nào để thiết lập một cơ sở dữ liệu, bạn nên liên hệ với chủ nhà của bạn. If all else fails you may find help at the WordPress Support Forums. Nếu vẫn thất bại bạn có thể tìm giúp tại Diễn đàn Hỗ trợ WordPress.

Error establishing a database connection Lỗi thiết lập kết nối cơ sở dữ liệu

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. Điều này có nghĩa là hoặc tên người dùng và mật khẩu của bạn thông tin trong wp-config.php tập tin không đúng, hay chúng tôi không thể liên lạc với máy chủ cơ sở dữ liệu ở localhost. This could mean your host's database server is down. Điều này có thể có nghĩa là máy chủ cơ sở dữ liệu lưu trữ của bạn là xuống.

Are you sure you have the correct username and password? Bạn có chắc là bạn có đúng tên và mật khẩu?
Are you sure that you have typed the correct hostname? Bạn có chắc chắn rằng bạn đã gõ đúng tên máy?
Are you sure that the database server is running? Bạn có chắc chắn rằng các máy chủ cơ sở dữ liệu đang chạy?

These default Wordpress database error pages are more meant for website administrators or webmasters rather than the public visitors. Những mặc định Wordpress cơ sở dữ liệu các trang lỗi có nhiều ý nghĩa cho các quản trị website hoặc quản trị web hơn là các du khách công cộng. 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. Tuy nhiên, bạn có thể thay đổi trang báo lỗi đến một trang lỗi khác nhau bằng cách sửa đổi hoặc thay đổi Câu hỏi thường gặp và các văn bản trong trang lỗi bằng cách đặt các file wp-db.php nằm ở wp-bao gồm các thư mục. Here's how you can hack the Wordpress default error message. Đây là cách bạn có thể hack tin nhắn Wordpress lỗi mặc định.

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)”. Trong wp-db.php (các tập tin mà xử lý các kết nối cơ sở dữ liệu mà làm cho WordPress), bạn có thể thấy các dòng như "DB an - kết nối đến máy chủ và chọn một cơ sở dữ liệu" và "Chọn một DB (nếu nhau cần phải được chọn ) ". That's where you can alter the text and word in the error page. Đó là nơi bạn có thể làm thay đổi văn bản và từ trong trang lỗi. Just look carefully after the line, you will see exactly the some text and message as appeared on the database error page. Chỉ cần xem xét cẩn thận sau khi dòng này, bạn sẽ thấy một số văn bản chính xác và tin nhắn như xuất hiện trên các trang lỗi cơ sở dữ liệu. Edit them to your liking. Chỉnh sửa theo ý thích của bạn.

Wordpress Bail Chức năng
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”. Bên cạnh đó, từ dòng 312 trở đi là đầu trang và chân trang đầu ra cho HTML của trang báo lỗi kết nối cơ sở dữ liệu, chứa bên trong chức năng đặt tên là "bảo chứng", xác định những thứ như tiêu đề của "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. Các bảo chứng "chức năng" được gọi là bất cứ khi nào một lỗi kết nối cơ sở dữ liệu là gặp phải, và làm những gì nó tên nói - bails ra lỗi và hiển thị một thông báo lỗi thay vì để thông báo cho người sử dụng. You can change them if you like too. Bạn có thể thay đổi chúng nếu bạn thích quá.

Please take a backup of wp-db.php file before you customize or alter it. Xin lấy một bản sao lưu của file wp-db.php trước khi bạn tùy chỉnh hoặc thay đổi nó. If you break the code, your website visitors and surfers will get the PHP error instead. Nếu bạn chia code, du khách và người lướt web của bạn sẽ nhận được lỗi PHP thay thế. Beside, be careful that when you upgrade your WordPress. Bên cạnh đó, hãy cẩn thận khi bạn nâng cấp WordPress của bạn. 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. Nếu bạn ghi đè lên tất cả các file khi nâng cấp WordPress, các wp-db.php sẽ được thay thế trở lại với phiên bản gốc không thay đổi quá, và bạn phải chỉnh sửa các tập tin một lần nữa. Else, backup the wp-db.php before upgrading your WordPress and restore it after upgrading is done. Khác, sao lưu dự phòng wp-db.php trước khi nâng cấp WordPress của bạn và khôi phục lại nó sau khi nâng cấp được thực hiện.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.


One Response to “How to Customize, Modify or Change WordPress Database Connection Error Page” Một trong những đáp tới "Làm thế nào để Customize, Chỉnh sửa hoặc thay đổi kết nối WordPress Cơ sở dữ liệu Lỗi Trang"

  1. Zane Zane
    March 21st, 2009 23:51 21 Tháng 3 2009 23:51
    1 1

    Thanks! Cảm ơn!
    You Saved Me Here! Bạn đã lưu Me Here!

Leave a Reply Để lại một trả lời

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> Bạn có thể sử dụng các thẻ: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q <strike> <strong>

Subscribe to comments feature has been disabled. Thuê bao với ý kiến đều đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo mới nhất đăng ý kiến, đăng ký với My Digital Life Comments RSS feed My Digital Life kiến RSS feed or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong email tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm đến các Điều khoản Điều

wordpress database connection wordpress kết nối cơ sở dữ liệu - -- wordpress change database wordpress thay đổi cơ sở dữ liệu - -- wordpress database connection details wordpress kết nối cơ sở dữ liệu chi tiết - -- change wordpress database info wordpress thay đổi cơ sở dữ liệu thông tin - -- change database wordpress thay đổi cơ sở dữ liệu wordpress - -- change wordpress db thay đổi wordpress db - -- change database on wordpress thay đổi cơ sở dữ liệu trên wordpress - -- Connection Error to NDO DataBase ! Lỗi kết nối đến nBạn DataBase! - -- create wordpress database error page tạo wordpress Sửa lỗi cơ sở dữ liệu - -- how to maintain database connection for wordpress? làm thế nào để duy trì kết nối cơ sở dữ liệu cho wordpress? - -- which file in wordpress stores database connectivity info trong đó tập tin trong wordpress cửa hàng thông tin kết nối cơ sở dữ liệu - -- wordpress admin database change wordpress quản trị cơ sở dữ liệu thay đổi - -- wordpress database connection wordpress kết nối cơ sở dữ liệu - -- wordpress connecting different mysql wordpress kết nối mysql khác nhau - -- wordpress custom database connection wordpress tùy chỉnh kết nối cơ sở dữ liệu - -- wordpress connect other database wordpress kết nối cơ sở dữ liệu khác - -- wordpress sql connect wordpress sql kết nối - -- wordpress change database connection wordpress thay đổi cơ sở dữ liệu kết nối - -- all tất cả - -- connect to database wordpress kết nối với cơ sở dữ liệu wordpress - -- connecting to wordpress database kết nối với cơ sở dữ liệu wordpress - -- error establishing database connection wpmu mediatemple thiết lập cơ sở dữ liệu lỗi mediatemple Chính sách về kết nối - -- How to change wordpress database Làm thế nào để thay đổi cơ sở dữ liệu wordpress - -- where is the connection in wordpress for database mà là kết nối trong wordpress cho cơ sở dữ liệu - -- wordpress database connection problems wordpress vấn đề kết nối cơ sở dữ liệu - -- wordpress + database connection wordpress + kết nối cơ sở dữ liệu - --