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.

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ể.
Related Articles Bài viết liên quan
- How to Change the Frequency or Interval WordPress Auto Saves An Editing Post or Page Làm thế nào để thay đổi các tần số hoặc Interval WordPress Auto Tiết kiệm An Post Chỉnh sửa hoặc Trang
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working Paginating hoặc Split WordPress Đăng hoặc Trang với NextPage trong WordPress Không phải làm việc
- Error Has Occurred While Establishing A Connection To SQL Server 2005 Which Does Not Allow Local and Remote Connections Có lỗi xảy ra khi thiết lập một kết nối Để SQL Server 2005 nào Does Không Cho phép địa phương và Remote Connections
- How to Convert Character Set and Collation of WordPress Database Làm thế nào để set tự Convert và Collation của WordPress Cơ sở dữ liệu
- WordPress MySQL SQL Query Error in WPDB Class WordPress MySQL vấn SQL Error in WPDB Class
- Oracle EXP-00091 Error When Export Database Oracle EXP-00091 Lỗi Khi xuất khẩu Cơ sở dữ liệu
- IMP-00016 Required Character Set Conversion Not Supported Error when Import to Oracle Database IMP-00016 Bắt buộc Character Set Chuyển đổi không được Hỗ trợ Lỗi khi nhập vào Oracle Database
- Change Oracle Database User Password Cơ sở dữ liệu Oracle thay đổi mật khẩu người dùng
- Oracle Database Import Error 3113/3114 Oracle Database nhập Lỗi 3113/3114
- Modify and Change Remote Desktop Listening Port Sửa đổi và thay đổi Remote Desktop Nghe Port










































March 21st, 2009 23:51 21 Tháng 3 2009 23:51
Thanks! Cảm ơn!
You Saved Me Here! Bạn đã lưu Me Here!