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

Leo R. Lundgren leo at finalresort.org
Mon Jun 7 18:41:04 MDT 2010


Soo.. Have you tried to connect manually from your client/server to the mysql database server? For example using `mysql` in the terminal.

Apparently the remote server is saying that user XXXXX coming from the host exit445.com is not allowed access. This could be due to a number of reasons, but apart from the obvious ones maybe that user isn't allowed to connect from an external source and only from the remote server itself? The latter is a very common configuration at web hosts, access to the databases only being allowed from the web server(s).

Anyway, if you try it manually you might get a better feeling for it all than when there's a middle layer in between. For example:

	mysql -h remoteHostName.com -u XXXXX -p

.. should try to connect to the remote server and give you a prompt to enter your password. If that doesn't work I doubt you are allowed to connect from an external host.


8 jun 2010 kl. 02.30 skrev Jonathan Schwartz:

> Same:
> Where XXXXX = user name.
> 
> 
> 
> Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'XXXXX'@'exit445.com' (using password: YES) in/Library/WebServer/......./_testmysql.php on line 15
> Could not connect: Access denied for user 'XXXXX'@'exit445.com' (using password: YES)
> 
> At 4:23 PM -0700 6/7/10, david weiner wrote:
>> What happens when you run this with your credentials and all that:
>> <?php
>> $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
>> if (!$link) {
>>     die('Could not connect: ' . mysql_error());
>> }
>> echo 'Connected successfully';
>> mysql_close($link);
>> ?>
>> 
>> 
>> On Jun 7, 2010, at 3:27 PM, Jonathan Schwartz wrote:
>> 
>> > Steve,
>> >
>> > You have it right.
>> >
>> > I have total control over my own system.
>> >
>> > I have access to phpMYadmin on the MySQL system which is hosted by a big hosting company. I have not found the my.cnf or the logs, so I can't figure out what is happening.
>> >
>> > I have talked with thier tech support and they confirmed thatthe query should work, but I i will do it again.
>> >
>> > Sweet Dreams,
>> >
>> > Jonathna
>> >
>> >
>> >
>> >
>> >
>> > At 11:08 PM +0100 6/7/10, Steve Winter wrote:
>> >> I think the point Jonathan is trying to make is the it's not supposed to connect to the exit445 server but to another one...!
>> >>
>> >> Jonathan, it's late here, but I have a funny feeling that my.cnf might have something to do with this...??...
>> >>
>> >> Cheers
>> >> Steve
>> >>
>> >>
>> >> On 7 Jun 2010, at 22:25, Dale Bengston wrote:
>> >>
>> >>> Yes, it's making the connection, and the MySQL server is denying access for that username at exit445.com, presumably because there is no such user defined atexit445.com.
>> >>>
>> >>> What tool are you using to manage MySQL on the two servers? If you pop up the user management for each, I think this will make more sense. The exit445.comMySQL has a user set up to make connections to itself from its own IP, but it does not have a user set up to accept connections from another external server.
>> >>>
>> >>> Am I making this worse? It's been a long day. I stopped making sense a couple hours ago.
>> >>>
>> >>> Dale
>> >>>
>> >>> On Jun 7, 2010, at 3: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 toexit445.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
>> >>
>> >> Steve Winter
>> >> steve at bluecrocodile.co.nz
>> >> m: +44 77 7852 4776
>> >> 3 Calshot Court, Channel Way
>> >> Ocean Village, Southampton SO14 3GR
>> >>
>> >> I ran the London Marathon to raise money for UK Youth. You can still sponsor me here.
>> >>
>> >>
>> >> _______________________________________________
>> >> 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



-|

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20100608/51021c79/attachment.html


More information about the FX.php_List mailing list