CDbConnection failed to open the DB connection.




        'username'        =>'nidjapancorp_auto',

        'password'        =>'Pandia123',

        'charset'         =>'utf8',

        'enableProfiling' =>true,

        'schemaCacheID'        =>'fcache',



Got Error like this CDbConnection failed to open the DB connection…

But Normal Php Connections are working fine Why?

$conn = mysql_connect(‘’,‘nidjapancorp_auto’,‘Pandia123’);



echo "connectred";


$select =mysql_select_db("nidjapancorp_bs",$conn);



echo "db Selected";




echo "Db Not seletcted";


For starters, try using [font="Courier New"]host[/font] instead of [font="Courier New"]hostname[/font] in your connection string.

Ya Thanx a lot Now working fine,May i know the difference between hostname and host?

But I run one server Its working fine but i changed other server i got error like

this.I cant understand that Difference if You dont mind please explain me?

Well, I think [font=“Courier New”]hostname[/font] is not really a valid part of the DSN ;)

Ok ThanK You buddy…