How to Fix the Error Establishing a Database Connection in WordPress with Localhost XAMPP

I’ve received this error message “Error establishing a database connection” after I hosted my website locally with XAMPP. Then I double checked:

  • Database in phpMyAdmin;
  • wp-config.php (This setup actually triggered the problem).

wp-config.php

In order to solve this database connection issue in localhost by XAMPP is simple. Just change the username to ‘root’ and remove the password of database in wp-config. For instance:

Before

After

Easy peasy lemon squeezy!

 

</catmee> 文章全部原创、谢绝转载,作者「BianLei」,如果喜欢欢迎分享链接,相关内容参见本站版权声明
本站相关:哔哩哔哩 | QQ空间 | YouTube ★★★ 打赏:支付宝 ★★★
Tagged , . Bookmark the permalink.

Comment Anonymously? No Problem! | 可以匿名评论了我会说?

Fill up Email address to subscribe reply and display your avatar from Gravatar (If any)
填写邮箱即可显示您在Gravatar的头像