Yii Framework Forum: connect with remote database usign Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

connect with remote database usign Yii Rate Topic: -----

#1 User is offline   mostofa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 30-June 12

Posted 04 July 2012 - 12:58 AM

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)
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,353
  • Joined: 12-October 09
  • Location:Croatia

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?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users