No connection could be made because the target machine actively refused it (PHP / WAMP)

Edward picture Edward · Jul 17, 2013 · Viewed 125k times · Source

Note: I realise this could be seen as a duplicate but i have looked at the other responses and they didn't fix the problem for me.


I have recently installed Zend Studio and Zend Server with the mysql plugin on Windows 7.

I am not a qualified server administrator but neither am i completely incompetent; i have dedicated my day trying to get a local development 'server' up to cut down on upload/download times.

When I say server/machine i mean my home computer

I have come to a grinding halt trying to get mysql to work with Zend Server.

The error I keep receiving is (or verbose):

#2002 Cannot log in to the MySQL server
or (if i change to 'config' authentication type)
#2002 - No connection could be made because the target machine actively refused it.

The server is not responding (or the local server's socket is not correctly configured).

I have tried:

  • Change $cfg['Servers'][$i]['host'] from 'localhost' to '127.0.0.1'
  • Add/Remove $cfg['Servers'][$i]['socket'] = '';
  • Change from cookie to config auth type
  • reinstall server and mysql
  • Disable firewalls
  • Restarting machine

Zend's approach was to 'configure the phpmyadmin setup screen'... done that i don't know how many times.

Can anyone on here lend a hand, or point me in a direction that I haven't tried yet?

Answer

Wajdan Zahid picture Wajdan Zahid · Nov 29, 2015
  1. Go to C:\wamp\bin\mysql\mysql[your-version]\data
  2. Copy and save "ib_logfile0" and "ib_logfile1" anywhere else.
  3. delete "ib_logfile0" and ib_logfile1

Did the trick for me. hope it works for you too.

Its working fine. But we will have to stop apache and mysql, We need to quit xampp and then delete file. when deleted successfully. now start xampp it will work properly..