Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote mySQL problem

Status
Not open for further replies.

pease

Programmer
Apr 2, 2009
29
GB
Hi all,

I have a client on one server who logs into my content management system on another server, this CMS then connects to his database (on his server) to carry out the updates.

All was fine and dandy until yesterday.

My hosting company moved all sites over to a new server and as a result a new IP so I received a call from the client complaining that the db wasnt connecting.

When I realised the server change I added the new IP address to his list of allowed connections however I still get a connection error.

Thinking it was a DNS issues we left it overnight however its still the same (12 hours later).

Any thoughts?
 
flushed priviliges?

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Im going to sound dim because Ive never needed to do that before, the site is on shared hosting and I dont have command line access however if I attempt to do a flush privileges in phpMyAdmin I get an "Access denied you need the RELOAD permisson"

Just to give an update on the original problem.

If I add the sites IP address (say 111.222.33.44) to the allowed Remote Access Hosts then I get the following message when attempting to connect from the other site...

Code:
I cannot connect to the database because: Access denied for user 'site2_admin'@'111.222.33.44' to database 'site2_site2db'

If I remove that IP address from being allowed then I get a slightly different message...

Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'site2_admin'@'111.222.33.44' (using password: YES) in /home/site1/public_html/control_panel/phpfuncts.php on line 27
I cannot connect to the database because:

So the addition of the IP address definitely seems to have some effect. Thing is, this is a site which is used and updated daily and all was fine until site1's IP address changed.
 
Looks like a location/permission issue.

Myslq is picky about where you connect to it from.

userA@loalhost can have different permissions than userA@111.222.33.44 and even different permissions than userA@111.222.33.55 for instance.

While the user was able to connect from the previous IP address, it cannot do so form the new one.

Go into the MySql Administrator, and set the new IP address as a valid location from which the specified user can connect.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Apologies but again Im feeling dense.

I have already added then removed then added again the correct IP address to the Remote Access Hosts list.

Are you talking about something different to that when you say about using MySql Administrator and setting it for the user?

I cant seem to find anywhere in Control panel that allows me to register an IP address against a specific MySQL user?
 
I have already added then removed then added again the correct IP address to the Remote Access Hosts list.

Was this to the firewall, or to the mysql user itself in the DB?


Mysql administrator is a tool offered from MYSQL to manage users, and connections for the database, amongst other managerial tasks:
mysqladmin.jpg


You can set from which addresses the specified user is allowed to connect, and what privileges the user can have if it connects from different addresses.

If you don't have it you can download it from MYSQL.com




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top