title: Wampserver icon not going green fully, mysql services not starting up?
body: <p>I'm running an application on <code>localhost</code>, it's been running successfully for at least a year now, but suddenly today wampserver isn't starting up. Whenever I rightclick on the taskbar icon and "start all services", it gets orange, but never green. Yesterday there was a data loss problem because one of the mysql tables crashed and had to be repaired, if that's related to this in any way.</p>
  
  <p>If I try <code>http://localhost/phpmyadmin</code>, I get a <code>403 Forbidden</code> error, which I never got before.</p>
  
  <p>I checked the apache log today and its latest entries are:</p>
  
  <pre><code>[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:25, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [&lt;a href='function.mysql-real-escape-string'&gt;function.mysql-real-escape-string&lt;/a&gt;]: A link to the server could not be established in D:\\wamp\\www\\zeejflow\\index_exe.php on line 25, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:25, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [&lt;a href='function.mysql-real-escape-string'&gt;function.mysql-real-escape-string&lt;/a&gt;]: [2002] No connection could be made because the target machine actively  (trying to connect via tcp://localhost:3306) in D:\\wamp\\www\\zeejflow\\index_exe.php on line 26, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:26, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [&lt;a href='function.mysql-real-escape-string'&gt;function.mysql-real-escape-string&lt;/a&gt;]: No connection could be made because the target machine actively refused it.\r\n in D:\\wamp\\www\\zeejflow\\index_exe.php on line 26, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:26, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [&lt;a href='function.mysql-real-escape-string'&gt;function.mysql-real-escape-string&lt;/a&gt;]: A link to the server could not be established in D:\\wamp\\www\\zeejflow\\index_exe.php on line 26, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:26, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_num_rows() expects parameter 1 to be resource, integer given in D:\\wamp\\www\\zeejflow\\index_exe.php on line 34, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP   2. mysql_num_rows() D:\\wamp\\www\\zeejflow\\index_exe.php:34, referer: http://localhost/zeejflow/index.php
  [Sat Jul 20 14:17:33 2013] [error] an unknown filter was not added: DEFLATE
  [Sat Jul 20 14:17:33 2013] [error] an unknown filter was not added: DEFLATE
  [Sat Jul 20 14:17:33 2013] [error] an unknown filter was not added: DEFLATE
  </code></pre>
  
  <p>Lines 25 and 26 on index_exe.php are simply as below (I was trying to log in to the application): </p>
  
  <pre><code>$userName = mysql_real_escape_string($_POST['userName']);
  $Password = mysql_real_escape_string($_POST['Password']);
  </code></pre>
  
  <p>Because of the <code>[2002] No connection could be made because the target machine actively  (trying to connect via tcp://localhost:3306</code> error, I figured maybe there's a problem with some other application using the same port, so I tried the following (my wamp is running on D:) :</p>
  
  <pre><code>C:\Users\admin&gt;netstat
  
  Active Connections
  
    Proto  Local Address          Foreign Address        State
    TCP    127.0.0.1:5939         localhost127:49313     ESTABLISHED
    TCP    127.0.0.1:5939         localhost127:49317     ESTABLISHED
    TCP    127.0.0.1:49155        localhost127:49156     ESTABLISHED
    TCP    127.0.0.1:49156        localhost127:49155     ESTABLISHED
    TCP    127.0.0.1:49157        localhost127:49158     ESTABLISHED
    TCP    127.0.0.1:49158        localhost127:49157     ESTABLISHED
    TCP    127.0.0.1:49311        localhost127:49312     ESTABLISHED
    TCP    127.0.0.1:49312        localhost127:49311     ESTABLISHED
    TCP    127.0.0.1:49313        localhost127:5939      ESTABLISHED
    TCP    127.0.0.1:49315        localhost127:49316     ESTABLISHED
    TCP    127.0.0.1:49316        localhost127:49315     ESTABLISHED
    TCP    127.0.0.1:49317        localhost127:5939      ESTABLISHED
    TCP    127.0.0.1:49320        localhost127:49321     ESTABLISHED
    TCP    127.0.0.1:49321        localhost127:49320     ESTABLISHED
    TCP    192.168.15.200:49166   server6201:5938        ESTABLISHED
    TCP    192.168.15.200:49847   Server-PC:netbios-ssn  TIME_WAIT
    TCP    192.168.15.200:49848   Server-PC:netbios-ssn  TIME_WAIT
  
  D:\&gt;netstat
  
  Active Connections
  
    Proto  Local Address          Foreign Address        State
    TCP    127.0.0.1:80           localhost127:49799     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49800     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49801     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49802     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49803     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49804     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49806     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49810     TIME_WAIT
    TCP    127.0.0.1:80           localhost127:49811     TIME_WAIT
    TCP    127.0.0.1:5939         localhost127:49313     ESTABLISHED
    TCP    127.0.0.1:5939         localhost127:49317     ESTABLISHED
    TCP    127.0.0.1:49155        localhost127:49156     ESTABLISHED
    TCP    127.0.0.1:49156        localhost127:49155     ESTABLISHED
    TCP    127.0.0.1:49157        localhost127:49158     ESTABLISHED
    TCP    127.0.0.1:49158        localhost127:49157     ESTABLISHED
    TCP    127.0.0.1:49311        localhost127:49312     ESTABLISHED
    TCP    127.0.0.1:49312        localhost127:49311     ESTABLISHED
    TCP    127.0.0.1:49313        localhost127:5939      ESTABLISHED
    TCP    127.0.0.1:49315        localhost127:49316     ESTABLISHED
    TCP    127.0.0.1:49316        localhost127:49315     ESTABLISHED
    TCP    127.0.0.1:49317        localhost127:5939      ESTABLISHED
    TCP    127.0.0.1:49320        localhost127:49321     ESTABLISHED
    TCP    127.0.0.1:49321        localhost127:49320     ESTABLISHED
    TCP    192.168.15.200:49166   server6201:5938        ESTABLISHED
    TCP    192.168.15.200:49805   mrs02s05-in-f4:http    ESTABLISHED
  </code></pre>
  
  <p>But now I don't know what to make of this. I made sure my.ini had specified port 3306, and it had (anyway noone changed it in a year how could it suddenly have another value). Any help please! I think Apache is working because when I type in <code>http://localhost</code>, it works and gives the option to go to phpmyadmin or my application folder, but it appears mysql services aren't starting up or something? I confirmed with the admin and no new software (such as Skype) have been installed or anything. </p>
  
  <h2>Update</h2>
  
  <p>I went to <code>Services.msc</code> and checked <code>wampapache</code>,  the status was "started".
  But <code>wampmysqld</code> had no status. So I right-clicked and chose "Start".
  A message said "Windows is attempting to start the service on the local computer", but then I got this  error: </p>
  
  <pre><code>Windows could not start the wampmysqld service on Local Computer
  Error 1067: The process terminated unexpectedly
  </code></pre>
  
  <p>What on earth is up? :(</p>
  
  <h2>Update 2</h2>
  
  <p>I got the mysql working again, here:</p>
  
  <p><a href="https://stackoverflow.com/questions/17770846/mysqld-working-but-wampmysqld-not-starting-up/17770958#17770958">mysqld working but wampmysqld not starting up</a></p>
  
  <p>HowEVER, <code>localhost://phpmyadmin</code> still gives me a <code>403 forbidden</code> error, and <code>mysql_connect</code> keeps giving me an "Access denied" error.</p>