Bluehost.com Web Hosting $6.95

how do I get a remote db connection?

This is a discussion on how do I get a remote db connection? within the PHP General forums, part of the PHP Programming Forums category; I have two independent websites, both with their own mySQL db's. I would like to run a query in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-26-2003
Irvin Amoraal
 
Posts: n/a
Default how do I get a remote db connection?

I have two independent websites, both with their own mySQL db's. I would
like to run a query in site A against site B's database. I am trying to
establish a connection using something like:
$conn = mysql_connect("abc.com:3306", $user, $pass);

A warning is returned to the browser :
Access denied for user: 'abc@my_web_host.net' where my_web_host.net is the
name of the host server.

The db's name would be abc_com (This is not the actual name but the form is
consistent with the real db name).

If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
so I assume that I am able to communicate with the msSQL server itself, but
is a permissions issue. I know that the username and password are correct.

Could it be that remote acccess to the db is disabled? Or am I omitting
something?

Your help is appreciated.

Irvin Amoraal.


Reply With Quote
  #2 (permalink)  
Old 07-26-2003
John W. Holmes
 
Posts: n/a
Default Re: [PHP] how do I get a remote db connection?

Irvin Amoraal wrote:

> I have two independent websites, both with their own mySQL db's. I would
> like to run a query in site A against site B's database. I am trying to
> establish a connection using something like:
> $conn = mysql_connect("abc.com:3306", $user, $pass);
>
> A warning is returned to the browser :
> Access denied for user: 'abc@my_web_host.net' where my_web_host.net is the
> name of the host server.
>
> The db's name would be abc_com (This is not the actual name but the form is
> consistent with the real db name).
>
> If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
> so I assume that I am able to communicate with the msSQL server itself, but
> is a permissions issue. I know that the username and password are correct.
>
> Could it be that remote acccess to the db is disabled? Or am I omitting
> something?


Yes, more than likely. You need permission within the grant tables for
Site A to connect to it from host Site B.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com




Reply With Quote
  #3 (permalink)  
Old 07-26-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] how do I get a remote db connection?

* Thus wrote Irvin Amoraal (irvin@cabletv.on.ca):
> I have two independent websites, both with their own mySQL db's. I would
> like to run a query in site A against site B's database. I am trying to
> establish a connection using something like:
> $conn = mysql_connect("abc.com:3306", $user, $pass);
>
> A warning is returned to the browser :
> Access denied for user: 'abc@my_web_host.net' where my_web_host.net is the
> name of the host server.
>
> The db's name would be abc_com (This is not the actual name but the form is
> consistent with the real db name).
>
> If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
> so I assume that I am able to communicate with the msSQL server itself, but
> is a permissions issue. I know that the username and password are correct.


Correct.

>
> Could it be that remote acccess to the db is disabled? Or am I omitting
> something?


Yes, the remote host doesn't allow connection from the host you are
conecting to. You'll need to add permissions on B's database for
host A.

HTH,

Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Reply With Quote
  #4 (permalink)  
Old 07-26-2003
Irvin Amoraal
 
Posts: n/a
Default Thanks!

Thanks to both John and Curt who gave me the same answer ... and it actully
makes sense. Don't know why I didn't think of it myslef <g>.

Irvin.

"Irvin Amoraal" <irvin@cabletv.on.ca> wrote in message
news:20030726153704.57616.qmail@pb1.pair.com...
> I have two independent websites, both with their own mySQL db's. I would
> like to run a query in site A against site B's database. I am trying to
> establish a connection using something like:
> $conn = mysql_connect("abc.com:3306", $user, $pass);
>
> A warning is returned to the browser :
> Access denied for user: 'abc@my_web_host.net' where my_web_host.net is the
> name of the host server.
>
> The db's name would be abc_com (This is not the actual name but the form

is
> consistent with the real db name).
>
> If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
> so I assume that I am able to communicate with the msSQL server itself,

but
> is a permissions issue. I know that the username and password are correct.
>
> Could it be that remote acccess to the db is disabled? Or am I omitting
> something?
>
> Your help is appreciated.
>
> Irvin Amoraal.
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0