简体   繁体   English

在WordPress安装中建立数据库连接时出错

[英]Error establishing database connection in WordPress install

I am working with a managed server from 1&1 and I am trying to manually install WordPress with no luck. 我正在使用1&1中的托管服务器,并且尝试手动安装WordPress时不走运。 I went and downloaded the WP core files, uploaded them via FTP and then went into mySQL and created the database and username/password etc. and assigned the privileges. 我去下载了WP核心文件,通过FTP上传了它们,然后进入mySQL并创建了数据库和用户名/密码等,并分配了权限。 When I try to install wordpress via "www.example.com/wp-admin/install.php ", I continuously receive the error: 当我尝试通过"www.example.com/wp-admin/install.php ”安装wordpress时,我不断收到错误消息:

Error establishing a database connection 建立数据库连接时出错

I tried everything and triple checked my user,password, etc. 我尝试了一切,并三重检查了我的用户,密码等。

Here is my credentials (Password is hidden): 这是我的凭据(密码被隐藏):

在此处输入图片说明

在此处输入图片说明

// ** MySQL settings ** //
/** The name of the database for WordPress */
define('DB_NAME', 'yourdb');

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

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

/** MySQL hostname */
define('DB_HOST', 'hostname');

Host name is always a localhost. 主机名始终是本地主机。 for check your database credential is correct or not please feel a wrong value @ let me know I am here 用于检查您的数据库凭据是否正确,请输入一个错误的值@让我知道我在这里

Try use 127.0.0.1 instead of localhost as the db host. 尝试使用127.0.0.1代替localhost作为数据库主机。 Had the same issue and this fixed it for me. 有同样的问题,这为我解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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