Forum Moderators: coopster

Message Too Old, No Replies

MySQL Problems

         

willybfriendly

5:20 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I hope that next time I even think about making changes on a perfectly functional system that someone slaps me back to reality.

I am running apache 1.3.27 on Win XP. I have MySQL 4.0.12 and PHP 2.4.0. All of this is running as a local service for development purposes.

Things were working fine. I am now getting the error "Can't connect to MySQL server on 'localhost'(10061)". This after I foolishly decided to upgrad to the newer versions of MySQL and PHP.

I have tried a compete uninstall and reinstall.

Same error.

I have confirmed that MySQL is running.

I have tried ressetting privileges, thinking that their might be a problem in the grant tables.

Same error.

I searched the MySQL web site. It appears that others have had similar problems, but I could not get any of the suggestions found their to solve the problem.

I searched Google. If I enter the error as a search term I immediately discover that a LOT of people out there are having the same error. Their sites do not work. Clicking the link simply brings up a page with the error message (Gotta' love Google).

In short, I have reached the end of my knowledge base and resources. I am not great at the operating level, and my knowledge of MySQL is a working knowledge only.

Do any of you gurus have words of wisdom that can help me to move beyond this state of utter frustration? (It would be nice if you could tell me how to access my DB while you are at it.)

Thanks in advance.

WBF

DrDoc

6:24 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using a username and password to connect to the database?

$conn = mysql_connect("localhost", "username", "password");
$db = mysql_select_db("database name");
$lookup = mysql_query("mySQL query");
...

willybfriendly

6:39 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, I am using a username and password. I have set a password for root. I have also created a user with all privileges with a password. I flushed the priveleges after making changes. Also tried a reboot.

I can access MySQL from the command line, so I know it is running. I just can't get it to connect with PHP. I have gone through the configuration files of all three line by line.

Oh, when I tried to telnet port 3306, which was suggested in an error message on the command line, I get a message that it cannot connect. Not surprising since it is set up to connect via TCP/IP.

I suspect it is something really simple that I am just not seeing, but given its prevalence on sites across the web, it must be something that a lot of others aren't seeing also.

WBF

Allen

8:07 am on Apr 14, 2003 (gmt 0)

10+ Year Member



Port's are part of the TCP/IP protocol.

You need to check what port your copy of MySQL is setup to run on. Maybe you accidentally changed it.

Allen

andreasfriedrich

10:30 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Make sure that you have only a single my.ini file on your system or in case you have more that you know which one will be actually used by MySQL [mysql.com]. Check which port is specified in your my.ini file. Use the same port to connect via PHP [php.net].

Check that you have a single PHP [php.net].ini and make sure that MySQL [mysql.com].default_port is either set to the right port or not set at all.

Andreas

nosanity

3:33 pm on Apr 14, 2003 (gmt 0)

10+ Year Member



You might also want to check to make sure any firewall software you have installed isn't blocking the connection.

noSanity

Fischerlaender

4:20 pm on Apr 14, 2003 (gmt 0)

10+ Year Member



I'd suggest to do the following steps:
1. Search for the my.ini file that is used by your mysql server.
2. Look which port is specified in it.
3. Try to connect to this port via telnet.
4 If you get something like "Connected to localhost.", then goto step 6.
5. You have a problem connecting to your mysql server. Check that it is really running and that there is no firewall active. (ZoneAlarm is known to block connections even if you think it isn't running.)
6. The problem seems to be on the PHP side. Be sure that PHP is configured to connect to the port that you were able to connect to in step 4.
(7. If it still isn't working, goto step 1. ;-) )

willybfriendly

7:40 pm on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you nosanity. It appears that it was indeed a firewall problem. Sometimes a person just doesn't know where to begin looking. Gotta' love computers, huh?

WBF