2011-12-18 78 views
2

我真的很困惑wordpress安装。 wp_config文件具有我的mysql(localhost)实例的根用户名和密码,并且我创建了一个名为'wordpress'的空白数据库(我不确定我是否应该创建一个数据库)。在OS X上安装wordpress错误建立连接

当我去http://localhost/wordpress/时,我收到一条'Error establishing a database connection'消息。我想有一个名为'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', ''); 

回答

0

与WordPress,你应该有一个数据库已经建立(无表,只是数据库)。

所以第一个选项应该是数据库名称。如果您使用的是共享主机,则数据库名称前可能会有一个前缀。

然后数据库的用户(应该在建立数据库时设置)。

然后是该用户的密码。

然后,最后,主机通常是localhost,但如果你在共享主机上,它可能会有所不同。您必须检查您的托管服务提供商文档以确保。

此外,你应该去的第一个地方是:http://localhost/wordpress/wp-admin/install.php