SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Jan 21, 2005, 12:49 #1
- Join Date
- Dec 2001
- Posts
- 198
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
connecting to remote mysql db not working, always same error
I have server1 with a mysql database and working php website. I also have a new server2 with most of the php files and it should connect to mysql db on server1 to get all of its data. The new user I made for this on the mysql db has "%" as host and all needed global priveleges as far as I can tell. But its not working.
This is how I connect :
mysql_connect("69.9.166.6", "server2", "somepassword");
And I always get this error :
Warning: mysql_connect(): Can't connect to MySQL server on '69.9.166.6' (111)
Now I changed a lot of settings already, I tried different host values, new users, different priveleges, all ip's of the server or the websites on it... but always the same error. The port number is standard so should be ok too. So I assume that there's nothing wrong with the user settings or the code itself, and that the problem must be somewhere else. But I cant imagine what more that could go wrong here.... Maybe server1 is blocking all incoming connections or something like that ?
Can anyone give me some directions on how to find the problem and how I might solve it ?
Thanks
-
Jan 21, 2005, 14:43 #2
- Join Date
- Nov 2003
- Location
- Ohio
- Posts
- 411
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Are the host permissions set to allow your IP to connect to the sql server remotely or are they locked down to localhost?
Freelance System Administrator, Researcher, Writer
Practical Applications
Open Sourcery "SitePoint's Open Source Blog"
-
Jan 21, 2005, 18:42 #3
- Join Date
- Dec 2001
- Posts
- 198
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes, its set to "%" wich should match all ip's
but I found the problem : "skip-networking" was in my.cnf, think its standard on for safety, had to uncomment it and now everything works fine
Bookmarks