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:203.190.10.85:3306 and its a linux server path:/var/lib/mysql/mysql.sock
2. And I wanted to connect it from another host:203.190.10.131 using a Yii->CDbConnection class
3. I give permission from the Mysql DATABASE ENGINE in that database which i want to access from 203.190.10.131
4. the permission is any host
5. but the problem is giving that
Note:
1.
its already successfully connected with core function of mysql
such as:
mysql_connect('203.190.10.85:3306/var/lib/mysql/mysql.sock','user','password' );
and return data that i want
2.
but also try with PDO
the same problem is giving that is giving in Yii CDbConnection
my syntax writing of Yii:
$dsn='mysql:host=203.190.10.85:3306//var/lib/mysql/mysql.sock;port:3306;dbname=mydb';
$user='user';
$pass='password';
$con=new CDbConnection($dsn,$user,$pass);
$con->active=true;
but its giving error this:
SQLSTATE[28000] [1045] Access denied for user 'author'@'localhost' (using password: YES)
Page 1 of 1
connect with remote database usign Yii
#2
Posted 04 July 2012 - 02:06 AM
The first thing I noticed is that you set the username "user" but the error say "author" -
Find more about me.... btw. Do you know your WAN IP?
Share this topic:
Page 1 of 1

Help











