在Wordpress上建立数据库连接时出错 [英] Error establishing a database connection on wordpress

查看:279
本文介绍了在Wordpress上建立数据库连接时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用wordpress的博客,但有时我对此有疑问

i have a blog with wordpress but sometimes i have problem with that

我遇到打击错误

建立数据库连接时出错 这意味着wp-config.php文件中的用户名和密码信息不正确,或者我们无法通过%s与数据库服务器联系.这可能意味着您主机的数据库服务器已关闭.

Error establishing a database connection 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 %s. This could mean your host's database server is down.

您确定您具有正确的用户名和密码吗? 您确定输入了正确的主机名吗? 您确定数据库服务器正在运行吗? 如果不确定这些条款的含义,则应联系您的房东.如果您仍然需要帮助,可以随时访问WordPress支持论坛

Are you sure you have the correct username and password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running? If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums

这是我的配置文件

define('WP_HOME','http://www.mysite.com');
define('WP_SITEURL','http://www.mysite.come');
define('DB_NAME', 'mydbname');

/** MySQL database username */
define('DB_USER', 'dbusername');

/** MySQL database password */
define('DB_PASSWORD', 'dbpassword');

/** MySQL hostname */
define('DB_HOST', 'mysite.com');

为什么我会收到此错误有时?您如何看待这个问题?

why i got this error sometimes what do you think about this problem?

我与我的管理员服务器联系,他们说我们的服务器和mysql服务没有任何问题"

i contact with my admins server and they said "we dont have any problem with server and mysql service"

我的服务器有问题还是配置有问题?

does my server have problem or my config have problem?

推荐答案

为什么我会收到此错误有时?您如何看待这个问题?

why i got this error sometimes what do you think about this problem?

那是关键;如果只在某些时间 发生,则这是网络主机上的间歇性问题.虚拟主机需要在MySQL日志和PHP日志中查找连接错误,超时,MySQL崩溃等,这些都可以指出间歇性问题的原因.

That's the key; if it only happens sometimes, it's an intermittent issue at the webhost. The webhost needs to look in the MySQL logs and PHP logs for connection errors, timeouts, MySQL crashes, etc, anything that will point to the cause of the intermittent issues.

如果始终出现建立数据库连接时出错",则表明您在wp-config.php中犯了确定的错误.

If you had "Error establishing a database connection" all the time, that points to a definite error you made in wp-config.php.

告诉网络主机和管理员查看其日志,以查看MySQL服务器何时关闭以及原因.

Tell the webhost and administrator to look at their logs to see when the MySQL server is going down and why.

如果这是您自己的服务器,则需要了解操作系统和其他详细信息,以便可以在Stack Overflow中搜索相关信息.日志位置因操作系统而异.

If this is your own server, you need to know the OS and other details so you can search Stack Overflow for the information. Log locations vary, depending on the OS.

这篇关于在Wordpress上建立数据库连接时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆