During the WordPress installation, you will be asked to fill in database information to establish a connection. If you fill in this information incorrectly, the installation will fail or your website will not work properly. Therefore.Accurate recording and proper maintenance of database information is a crucial step. This section will tell you what information you need to record, how to record it, and how to avoid common mistakes.
The 4 core pieces of information that must be recorded
Immediately after creating your database, whether you created it through the pagoda panel or otherwise, you need to record the following 4 pieces of information (one is missing from the WordPress installation):
| Message Name | Description and examples | significance |
|---|---|---|
| database name | The name of the database you created, such as wp_blog2023 | ⭐⭐⭐⭐⭐ |
| Database User Name | The username to access this database, such as wp_user | ⭐⭐⭐⭐⭐ |
| Database Password | Password corresponding to the user name (strong password) | ⭐⭐⭐⭐⭐ |
| Database host address | The address of the server where the database resides, usually localhost | ⭐⭐⭐⭐⭐ |
How is this information obtained and recorded?
Using the pagoda panel as an example, the steps to obtain this information are very simple:
- Login Pagoda PanelIf you want to manage the database, go to the "Database" management page.
- In the list of databases, find the database you created for WordPress and click on "Details" on the right side or view the list information directly.
- In the message displayed, find and record it:
- Database name (e.g.
wp_shop) - Username (e.g.
wp_admin) - Database host (default display is
localhost)
- Database name (e.g.
- Passwords need to be confirmed separately:
- If you remember the password that was generated when you created it, just record it.
- If you forget your password, click "Reset Password" to generate a new password.Record Now(The new password is displayed only once).
Recommended Recording Methods:
Create a new notepad file (named "WordPress Database Information.txt") and fill it out in the following format:
数据库名:wp_mywebsite
数据库用户名:wp_user123
数据库密码:K8x$pQ9Lm2@zR7tY(示例强密码)
数据库主机:localhost
数据库端口:3306(默认,一般无需填写)
Once saved, store the file on your computer's desktop or in a cloud note (e.g. Impression Notes, Notion) to ensure that you can find it quickly when installing WordPress.
Common Misconceptions and Precautions
- Don't handwrite your password, make sure you copy and paste it.Database passwords are usually strong randomly generated passwords (containing upper and lower case letters, numbers, and symbols), and hand-typing is highly error-prone. It is recommended to copy and paste it directly into the log file, and then copy it from the file when installing.
- "Database Host" is not a server IPNewcomers often mistakenly think that the "database host" needs to be the public IP of the server (e.g.
123.45.67.89), but actually:- When the database and website files are on the same server, the host address defaults to
localhost(localhost). - A specific IP or domain name is only required if the database is deployed on a separate server (which is rare and hardly ever encountered by novices).
- When the database and website files are on the same server, the host address defaults to
- The port number is generally not requiredThe default port for the MySQL database is
3306WordPress automatically uses this port, so you don't need to fill it in when installing, unless your server has other ports set up for you (check with your server provider). - risk of information leakageDatabase information belongs to the core confidentiality of the website, and if it is accessed by others, it may lead to data tampering or deletion. Therefore:
- Do not send log files in clear text (e.g., directly from WeChat).
- Once the site is live, it is recommended that the log files be moved to a secure location (e.g., an encrypted folder).
Forgot your info? Retrieve it this way!
If you accidentally lose your recorded database information, don't worry, you can easily retrieve it through the Pagoda panel:
- Database name, user name, host address: Viewed directly on the Pagoda "Database" page.
- Database Password: Click "More" → "Change Password" in the database list to generate a new password and re-record it (the old password cannot be viewed and can only be reset).
Tip: After changing the password, if the website has been installed, you need to synchronize and update the password in the WordPress configuration file (wp-config.php), otherwise the website will prompt "database connection error".
wrap-up
The database information is the "key" that connects WordPress to the data store, so recording it accurately and saving it properly is a prerequisite for a successful installation. Once you've documented it in this section, you'll be ready to move on to the next step - installing WordPress and filling in this information. Remember:If the message "Database connection failed" appears during the installation process, 90% is due to incorrect information, you should check the recorded information and try again.。