[FX.php List] Trouble connecting to remote mySQL DB

Gareth Evans gareth.evans at schawk.com
Mon Jun 7 16:32:40 MDT 2010


The host name part of the user account is actually the host it is connecting
from. So the response '[USER]'@'exit445.com' is correct assuming you are
connecting from exit445.com. The manual has a bit more info on it
http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html

You should check that the remote server's mysql has a user
'[USER]'@'exit445.com'.

Also check to see if skip-networking is NOT commented out in the my.cnf. If
it isn't then comment it and restart mysqld. You need networking enabled to
connect via a remote host.

If it's still not working change the host of the mysql users' account to be
IP based (the IP you are connecting from) or simply '%' (any host). If that
works then it might be an issue with a host lookup somewhere.

HTH
-- 
GARETH EVANS


> From: Jonathan Schwartz <jschwartz at exit445.com>
> Reply-To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> Date: Mon, 7 Jun 2010 14:16:45 -0700
> To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> Subject: Re: [FX.php List] Trouble connecting to remote mySQL DB
> 
> Hiya Joel,
> 
> The actual query contains a real user name. I replaced it with
> "[USER]" in this email for security.
> 
> The real focus is that the HOST NAME in the error message is being
> reported as "Exit445.com".  Exit455.com is MY LOCAL server, not the
> REMOTE server where the mySQL system is.  The mysqlconnect query
> contains the name of the REMOTE server, but the error refers to my
> LOCAL server
> 
> That is the confusing part.
> 
> I would be fine chasing down a problem in the remote server if it was
> reported as an remote error.
> 
> Jonathan
> 
> 
> 
> At 2:01 PM -0700 6/7/10, Joel Shapiro wrote:
>> Hi Jonathan
>> 
>> From the "Warning" you posted, it looks to me like the username
>> that's being denied is:  '[USER]'@'exit445.com'
>> 
>> Per Dale's comment, is '[USER]'@'exit445.com' a valid username?
>> 
>> -Joel
>> 
>> 
>> On Jun 7, 2010, at 1:52 PM, Jonathan Schwartz wrote:
>> 
>>> Thanks, Dale.
>>> 
>>> This assumes that the query is actually hitting the remote server
>>> and failing.
>>> 
>>> The error message suggests that the query is being directed to the
>>> local server, not the remote server.
>>> 
>>> Still scratching my head.
>>> 
>>> Jonathan
>>> 
>>> 
>>>> Hi Jonathan,
>>>> 
>>>> There has to be a MySql user on the live site that will accept
>>>> requests from your IP address or domain. Generally, this is pretty
>>>> locked-down and you have to add the proper user account.
>>>> 
>>>> Hope this helps,
>>>> Dale
>>>> 
>>>> 
>>>> 
>>>> On Jun 7, 2010, at 11:20 AM, Jonathan Schwartz wrote:
>>>> 
>>>>> Sorry for the off topic post.
>>>>> 
>>>>> Some background...This is my one foray into mysql, where I'm
>>>>> using a mysql db on a client's primary website as a way to
>>>>> control web traffic to two other servers, where FileMaker Web
>>>>> Publihsing is running.  In short, the mysql db has just 10
>>>>> records, providing location and status of the various processes
>>>>> offered on the FieMaker servers.  We use it to put up "We'll be
>>>>> right back" signs when maintenance is being performed, among
>>>>> other things.
>>>>> 
>>>>> I previously did this in FileMaker, but if Fileaker is down, it
>>>>> can not report on itself.
>>>>> 
>>>>> To the problem.  While I can perform mysql_connect from a php
>>>>> page on the www site, I can not connect up  to mysql from a php
>>>>> page located on the remote server.  I get the following error:
>>>>> 
>>>>> Warning: mysql_connect() [function.mysql-connect]: Access denied
>>>>> for user '[USER]'@'exit445.com' (using password: YES)
>>>>> in/Library/WebServer/Documents/..........opendb.php on line 4
>>>>> Error connecting to mysql
>>>>> 
>>>>> 
>>>>> This is being run from my server (exit445.com), attempting to
>>>>> talk to the remote server.  You can see that php is actually
>>>>> trying to talk to the host "exit445.com" instead. even though the
>>>>> the mysqlconnect command explicitly identifies the remote server
>>>>> as host (not exit445.com) . No matter what I do, the mysqlconnect
>>>>> command attempts to talk to exit445.com.
>>>>> 
>>>>> I did check with the www host and there is no restriction from
>>>>> accepting remote quieries.
>>>>> 
>>>>> Assuming I understand what is happening, how do I convince php/OS
>>>>> X Server to talk with the remote server instead of the localhost?
>>>>> 
>>>>> Thx
>>>>> 
>>>>> Jonathan
>>>>> --
>>>>> Jonathan Schwartz
>>>>> Exit 445 Group
>>>>> jonathan at exit445.com
>>>>> http://www.exit445.com
>>>>> 415-370-5011
>>>>> _______________________________________________
>>>>> FX.php_List mailing list
>>>>> FX.php_List at mail.iviking.org
>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>> 
>>>> 
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>> 
>>> 
>>> --
>>> Jonathan Schwartz
>>> Exit 445 Group
>>> jonathan at exit445.com
>>> http://www.exit445.com
>>> 415-370-5011
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> -- 
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-370-5011
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list