简体   繁体   中英

WordPress: Error establishing a database connection

This is my first time working with WordPpress.

I want to make it work on my localhost using xampp. I have followed the steps in the documentation and created a database but when I go to the URL localhost/database_name it gives me this result:

“建立数据库连接时出错”屏幕截图

I have searched to solve the problem and I found that I don't have wp-config.php file in the database so I created wp-config.php using wp-config-sample.php and when I created it and tried to configure it again in localhost/database_name it gave me this result:

WordPress 错误屏幕的屏幕截图表明它无法创建 wp-config.php 文件,因为它已经存在

I have tried to make a new database with a new configuration also but nothing worked. How can I solve this?

I would recommend you to double check the hostname and database name to get it sorted out that way. Which host are you using? Delete your configured wp-config.php and let the browser create one for you - it will also validate your credentials during creation and ensure you'll get the right settings from start.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM