connect with remote database usign Yii

Here I Got Problem when i want to connect with A remote database.

My full working progress is step by step declared below:

  1. I have a database located in a host: and its a linux server path:/var/lib/mysql/mysql.sock

  2. And I wanted to connect it from another host: using a Yii->CDbConnection class

  3. I give permission from the Mysql DATABASE ENGINE in that database which i want to access from

  4. the permission is any host

  5. but the problem is giving that


its already successfully connected with core function of mysql

such as:

mysql_connect(‘’,‘user’,‘password’ );

and return data that i want

but also try with PDO

the same problem is giving that is giving in Yii CDbConnection

[size="4"]my syntax writing of Yii:[/size]




$con=new CDbConnection($dsn,$user,$pass);


but its giving error this:

[size=“7”]SQLSTATE[28000] [1045] Access denied for user ‘author’@‘localhost’ (using password: YES) [/size]

The first thing I noticed is that you set the username “user” but the error say “author” - ???