#2003 - Can't connect to MySQL server on 'localhost' (10061)
Posted by: bzsim8 (---.mohistory.org)
Date: August 16, 2010 11:32PM

I am using Drupal to develop my website and when I imported a view, the whole system crashed. I was hoping someone here could give me some insight since I'm developing on a Wamp server.

I got some sort of message regarding "mysqld" and when I hit OK my site went off line. I tried to open phpMyAdmin and received :#2003 - Can't connect to MySQL server on 'localhost' (10061). I looked at the PHP log and it says:
[16-Aug-2010 19:24:13] PHP Warning: Lost connection to MySQL server during query
query: SELECT r.rid, r.name FROM role r INNER JOIN users_roles ur ON ur.rid = r.rid WHERE ur.uid = 1 in C:\wamp\www\Time Travelers\includes\database.mysqli.inc on line 128

[16-Aug-2010 19:24:13] PHP Warning: MySQL server has gone away
query: SELECT data, created, headers, expire, serialized FROM cache WHERE cid = 'variables' in C:\wamp\www\Time Travelers\includes\database.mysqli.inc on line 128

[16-Aug-2010 19:24:13] PHP Warning: MySQL server has gone away
query: SELECT * FROM variable in C:\wamp\www\Time Travelers\includes\database.mysqli.inc on line 128

[16-Aug-2010 19:24:13] PHP Notice: Undefined variable: variables in C:\wamp\www\Time Travelers\includes\bootstrap.inc on line 553

[16-Aug-2010 19:24:13] PHP Warning: MySQL server has gone away
query: UPDATE cache SET data = '', created = 1281986653, expire = 0, headers = '', serialized = 0 WHERE cid = 'variables' in C:\wamp\www\Time Travelers\includes\database.mysqli.inc on line 128

[16-Aug-2010 19:24:13] PHP Notice: Undefined variable: variables in C:\wamp\www\Time Travelers\includes\bootstrap.inc on line 560

[16-Aug-2010 19:24:13] PHP Warning: MySQL server has gone away
query: SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC in C:\wamp\www\Time Travelers\includes\database.mysqli.inc on line 128

[16-Aug-2010 19:24:13] PHP Warning: MySQL server has gone away
query: SELECT COUNT(pid) FROM url_alias in C:\wamp\www\Time Travelers\includes\database.mysqli.inc on line 128


Then I looked at the SQL log and it says, over and over again:
100816 14:30:13 [Note] Plugin 'FEDERATED' is disabled.
100816 14:30:14 InnoDB: Started; log sequence number 0 3150476779
100816 14:30:14 [Note] Event Scheduler: Loaded 0 events
100816 14:30:14 [Note] wampmysqld: ready for connections.
Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
100816 14:36:23 [Note] wampmysqld: Normal shutdown

100816 14:36:23 [Note] Event Scheduler: Purging the queue. 0 events
100816 14:36:23 InnoDB: Starting shutdown...
100816 14:36:24 InnoDB: Shutdown completed; log sequence number 0 3150476779
100816 14:36:24 [Warning] Forcing shutdown of 1 plugins
100816 14:36:24 [Note] wampmysqld: Shutdown complete

I have no clue what any of this means as I am a front-end developer. Any thoughts?

Re: #2003 - Can't connect to MySQL server on 'localhost' (10061)
Posted by: toumimi (---.19.72-86.rev.gaoland.net)
Date: August 18, 2010 03:07AM

If you use mysql_close function, consider using optional connexion parameter since it causes a crash on php version 5.3.0

Next problems occured because you don't catch errors if mysql_query fails.
Connection is lost but you continue to query it. If an error occurs, stop querying and eventually display an error.

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Sorry, only registered users may post in this forum.