在OS X上安装wordpress错误建立连接

use*_*305 3 php mysql wordpress

我对wordpress安装感到困惑.该wp_config文件对我的MySQL(本地主机)的实例的root用户名和密码,我创建了一个叫做"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', '');
Run Code Online (Sandbox Code Playgroud)

Elj*_*kim 11

有关 此信息,请参阅http://techtrouts.com/mac-mysql-does-not-connect-on-localhost-but-connects-on-127001/.

基本上,在Mac上的默认安装中,您必须连接到127.0.0.1而不是localhost.所以,如果你改变以下它应该工作.

/** MySQL hostname */
define('DB_HOST', '127.0.0.1');
Run Code Online (Sandbox Code Playgroud)