[英]Error establishing a database connection. While installing wordpress on Wamp Localhost
[英]Installing wordpress on OS X error establishing connection
我對wordpress安裝感到困惑。 wp_config文件有我的mysql實例(localhost)的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', '');
有關此信息,請參閱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');
使用Wordpress,您應該已經建立了數據庫設置(沒有表,只有數據庫)。
所以第一個選項應該是數據庫名稱。 如果您在共享主機上,則可能在數據庫名稱之前有前綴。
然后是數據庫的用戶(應該在設置數據庫時設置)。
然后是該用戶的密碼。
然后,最后,主機通常是localhost
,但如果你在共享主機上它可能是不同的。 您必須檢查您的托管服務提供商文檔以確定。
此外,您應該去的第一個地方是: http://localhost/wordpress/wp-admin/install.php
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.