2011-12-18 74 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