在OS X上安装WordPress时出现连接错误

3
我对 WordPress 的安装感到非常困惑。wp_config 文件中有我本地 MySQL 实例的根用户名和密码,我已经创建了一个名为“wordpress”的空数据库(我不确定是否应该先创建一个数据库)。
当我访问 http://localhost/wordpress/ 时,出现了“无法建立数据库连接”的错误信息。我需要先创建一个名为“wordpress”的数据库吗?
以下是我的配置文件凭据:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

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

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

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

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
2个回答

12

0

使用WordPress,你应该已经设置好了数据库 (没有表格,只有数据库)。

因此,第一个选项应该是数据库名称。如果你使用共享主机,则数据库名称之前可能会有一个前缀。

然后是数据库用户 (在设置数据库时应该已经设置好)。

然后是该用户的密码。

最后,主机通常是localhost,但如果你使用共享主机,则可能不同。你需要查看托管提供商的文档来确定。

此外,你应该首先访问的地方是:http://localhost/wordpress/wp-admin/install.php


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接