Forum Moderators: coopster

Message Too Old, No Replies

MySQL Help Urgent Please

Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (100

         

Anyango

9:13 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Hey Folks

i was coding a database script in php which uses mysql as backend, am not a newbie to either mysql or php, its been fun for years for me, but during my coding 5 mins before i just got

Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061)

I was not connected to internet so no chance of virus or so, niether any chance of configuration change issue by someone, how can this happen at once?
i restarted machine but still the same.

I am on a windows server.

Any Assistance?

Anyango

9:18 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



can't even connect using command line mysql tools , the service is running, i even restarted it and its current status is set to "Started" but still the same error.

I am stuck while i was doing very important work, immediate assistance appreciated

jatar_k

9:19 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



did you somehow change the user pass or anything else?

something changed obviously but it's hard to say what.

Can you still login via some other type of connection (phpmyadmin, shell etc)?

did the mysql server just die maybe?

<added>alright that answers that

any logs that might tell you something?

Anyango

9:24 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey, its kinda strange whats going on but honestly i was just writting code, i wrote a query on last page a select query it returned results and were ok, i put a limi 0,10 . saved the page refresh. boom! got that error.

Not able to login to mysql by any means

phpMyAdmin says

#2003 - The server is not responding

Does there use to be a temporary file or a log file where mysql stores some information and that limit would have exceeded?

Anyango

9:27 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i just tried to login from command line tool using other username that my mysql has. but for each of them, it says the same.

jatar_k

9:29 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe corrupted files or something?

you restarted the machine and the service already you said?

It is obviously having some problems responding to requests.

You could always back the tables and dbs and reinstall at worst.

Anyango

9:46 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes

Looks like Perhaps my antivirus or any thing or perhaps a virus would have corrupted the configuration, though i dont know how or why but i think i ll go with your suggestion, lets take a backup of databases and reinstall.

Anyango

9:50 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey J

a strange discovery.

i have an application named "php database wizard" which i think i used last time 1 year before, as just a last test before reinstalling, i ran that application and that connects to the server perfectly with standard 3306 port without any need of any change. and the connection is 100% current because it is showing all that recent data that i entered just before all that crash.

sounds strange na?

something fishy fishy going on

jatar_k

9:53 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have to say, very strange, I have no idea what might be going on.

Anyango

9:59 am on Jul 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey J

Thanks for being with me in bad time, that day. actually i finally found out that it was my firewall that suspected the traffic and stopped the service from responding to any and every request. I have set my firewall settings to maximum security so any and every request that is either not explicitly allowed by me is blokced. what i didnt know was that my firewall settings we also to allow firewall to judge itself and block any traffic automatically if it considers it a threat, and because my latest query was bringing back a huge amount of data for me to check worst case response time, the firewall bloked mysqld-nt.exe from usage of that port on the server and after i allowed it back to be able to use that port, it released the lock and everything went fine.

This post might not be some discussion but is surely first of all for Thanks to J , who stayed with me that time and secondly if anyone else ever encounters the same problem then they shouldnt panic before checking their firewalls.

Thanks

Kami

jatar_k

3:18 pm on Jul 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I was thinking something like firewall untill that one prgram connected, then it didn't make sense

live and learn glad I could at least be around though I didn't give any real answers.

Anyango

7:48 pm on Jul 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes actually that program which worked, used other port for connection then the standard one.

jatar_k

9:27 pm on Jul 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ah sneaky, good info