Reputation: 379
My DB connection works perfectly in web application. But when I try the same settings in console application it fails (I wrote connection settings in console.php file).
CDbConnection failed to open the DB connection: SQLSTATE[28000] [1045] Access denied for user 'username'@'host' (using password: YES)
I can't solve problem for 4 hours. What might be wrong?
Upvotes: 1
Views: 1020
Reputation: 36
if you want to connect to the same DB which you connect to in your web application then copy your 'db' => array(...)
in config/main.php to config/console.php
Upvotes: 0