0
我已經在面對MySQL設置時解決了這個問題,但是當我們使用PG的時候,我似乎沒有辦法解決這個問題。建立數據庫連接時出錯 - 使用Postgres/pg4wp
問題:錯誤建立一個數據庫連接
這裏是我的wp-config.php文件:
// ** Heroku Postgres settings - from Heroku Environment ** //
$db = parse_url($_ENV["DATABASE_URL"]);
if($_SERVER["SERVER_NAME"]==="localhost") {
define('DB_NAME','finpipe_dev_db');
/** MySQL database username */
define('DB_USER','ilia');
/** MySQL database password */
define('DB_PASSWORD','ilia');
/** MySQL hostname */
define('DB_HOST','localhost');
} else {
// ** Heroku Postgres settings - from Heroku Environment ** //
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME',trim($db["path"],"/"));
/** MySQL database username */
define('DB_USER',$db["user"]);
/** MySQL database password */
define('DB_PASSWORD',$db["pass"]);
/** MySQL hostname */
define('DB_HOST',$db["host"]);
}
/** 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','');
這裏是被Postgres的控制檯中我的輸出:
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------------+----------+----------+-------------+-------------+-----------------------
finpipe_dev_db | ilia | UTF8 | en_CA.UTF-8 | en_CA.UTF-8 |
我已經完成ALTER USER ilia WITH PASSWORD 'ilia';
然而,仍然受到打擊錯誤建立 ...
這是怎麼回事?