logo

网络星期一促销

  •  99.9% 在线时间
  •  免费 SSL 证书
  •  24/7 在线支持
  •  30天退款保证
立即开始

高达

91

%

OFF

02
19
56
55
网络星期一促销: 虚拟主机
低至 4.75CNH /月!
查看所有优惠
×

知识库

查找有关信息功能,故障排除指南,
以及与虚拟主机相关的其他技术信息的文章。

How to fix "Error establishing a database connection"

引用:
database wordpress error establishing connection mysql sql

If you ever see the 'Error establishing a database connection' message, this usually means that your website failed to connect to the database due to incorrect database configuration settings. For example, WordPress's database configuration file is wp-config.php, located in your WordPress installation's root (main) folder.

The most common causes are:

- Incorrect MySQL hostname used.
Make sure you are using the correct hostname. Hostinger does not use localhost, make sure you find out your accounts MySQL hostname.

- Incorrect MySQL username / password or database name.
Make sure to check the database name, username and password that your configuration file is using, it has to be identical to the information in your MySQL details page. Try to avoid using any special characters, such as "',~{]{]@", if you are having issues connecting to your database. Try changing your database password if you are unsure if you are using the correct password.

For further troubleshooting of this issue, consider checking out these tutorials:

https://www.hostinger.com/tutorials/wordpress/wordpress-error-establishing-database-connection
https://www.hostinger.com/tutorials/wordpress/how-to-find-out-Wordpress-database-name