12

What could be the problem of my MySQL database server in WAMP.

I can't open it. The error says:

MySQL said: Documentation
#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 checked the ports, but no other apps are using port 3306 which is dedicated to mysqld.

Here's what mysql.log says:

120728 22:34:40 [Note] Plugin 'FEDERATED' is disabled.
120728 22:34:42 InnoDB: The InnoDB memory heap is disabled
120728 22:34:42 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 22:34:42 InnoDB: Compressed tables use zlib 1.2.3
120728 22:34:43 InnoDB: Initializing buffer pool, size = 128.0M
120728 22:34:43 InnoDB: Completed initialization of buffer pool
120728 22:34:44 InnoDB: highest supported file format is Barracuda.
120728 22:34:52  InnoDB: Waiting for the background threads to start
120728 22:34:53 InnoDB: 1.1.8 started; log sequence number 74876578
wampmysqld: File '.\mysql-bin.000025' not found (Errcode: 2)
120728 22:34:53 [ERROR] Failed to open log (file '.\mysql-bin.000025', errno 2)
120728 22:34:53 [ERROR] Could not open log file
120728 22:34:53 [ERROR] Can't init tc log
120728 22:34:53 [ERROR] Aborting

120728 22:34:53  InnoDB: Starting shutdown...
120728 22:34:53  InnoDB: Shutdown completed; log sequence number 74876578
120728 22:34:53 [Note] wampmysqld: Shutdown complete

120728 22:35:16 [Note] Plugin 'FEDERATED' is disabled.
120728 22:35:16 InnoDB: The InnoDB memory heap is disabled
120728 22:35:16 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 22:35:16 InnoDB: Compressed tables use zlib 1.2.3
120728 22:35:16 InnoDB: Initializing buffer pool, size = 128.0M
120728 22:35:16 InnoDB: Completed initialization of buffer pool
120728 22:35:16 InnoDB: highest supported file format is Barracuda.
120728 22:35:32  InnoDB: Waiting for the background threads to start
120728 22:35:33 InnoDB: 1.1.8 started; log sequence number 74876578
wampmysqld: File '.\mysql-bin.000025' not found (Errcode: 2)
120728 22:35:33 [ERROR] Failed to open log (file '.\mysql-bin.000025', errno 2)
120728 22:35:33 [ERROR] Could not open log file
120728 22:35:33 [ERROR] Can't init tc log
120728 22:35:33 [ERROR] Aborting

120728 22:35:33  InnoDB: Starting shutdown...
120728 22:35:34  InnoDB: Shutdown completed; log sequence number 74876578
120728 22:35:34 [Note] wampmysqld: Shutdown complete

120728 22:35:42 [Note] Plugin 'FEDERATED' is disabled.
120728 22:35:42 InnoDB: The InnoDB memory heap is disabled
120728 22:35:42 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 22:35:42 InnoDB: Compressed tables use zlib 1.2.3
120728 22:35:42 InnoDB: Initializing buffer pool, size = 128.0M
120728 22:35:42 InnoDB: Completed initialization of buffer pool
120728 22:35:44 InnoDB: highest supported file format is Barracuda.
120728 22:35:59  InnoDB: Waiting for the background threads to start
120728 22:36:00 InnoDB: 1.1.8 started; log sequence number 74876578
wampmysqld: File '.\mysql-bin.000025' not found (Errcode: 2)
120728 22:36:00 [ERROR] Failed to open log (file '.\mysql-bin.000025', errno 2)
120728 22:36:00 [ERROR] Could not open log file
120728 22:36:00 [ERROR] Can't init tc log
120728 22:36:00 [ERROR] Aborting

120728 22:36:00  InnoDB: Starting shutdown...
120728 22:36:01  InnoDB: Shutdown completed; log sequence number 74876578
120728 22:36:01 [Note] wampmysqld: Shutdown complete

PS: I don't have a Skype. So I think it's not the conflict.

9
  • May be your firewall is blocking, did you checked port 443? or any other permission settings?
    – Mr. Alien
    Jul 28, 2012 at 14:56
  • 1
    Make sure your MySQL server is up. Also, Skype has nothing to do with port 3306. It's 80 and 443.
    – Nikola K.
    Jul 28, 2012 at 14:58
  • Never happened to me, but after some googling I found this this
    – Adi
    Jul 28, 2012 at 14:58
  • @NIKOLA Mysql server wasn't normally up. The WAMP SERVER icon stays at color orange. so that means not everything is up :( Jul 28, 2012 at 14:59
  • 1
    Wrong. Green color means everything's up. When it's orange, that means some of your services are down, probably MySQL server.
    – Nikola K.
    Jul 28, 2012 at 14:59

19 Answers 19

19

This works:

  1. Stop the MySQL service
  2. Open data folder
  3. Remove both ib_logfile0 and ib_logfile1
  4. Restart the service
5
  • This worked for me. But what caused this problem in the first place?
    – joshas
    Jan 15, 2016 at 21:47
  • where is that data folder you mean @saleh? Oct 4, 2016 at 0:23
  • 1
    Mine was located in /opt/local/var/db/mysql56 but this didn't help.
    – Jo Smo
    Oct 9, 2016 at 1:54
  • Thanks saleh Done. Dec 21, 2016 at 5:47
  • Nothing worked until that, for me. I've tried first deleting all files (but not directories!) in that directory, following some suggestions. But it messed with my DB, think. Deleting only these 2 files did the trick. It saved me, thanks!
    – mrarm
    Aug 6, 2017 at 15:55
10

Go to your MySQL directory and find mysql-bin.index then clear its content. Everything should work fine after that.

Source

2
  • This actually worked for me, I've had phpMyAdmin start up problems everytime I restart computer
    – GivenPie
    Jul 11, 2013 at 10:41
  • 2
    file does not exist in that folder Jul 2, 2015 at 5:27
4

I experienced this problem this morning for the first time while using mysql/easyphp. I tried clearing the contents of mysql-bin.index but that didn't work for me.

I restarted the computer and tried accessing mysql again and had no more issues.

0
4

I stopped mysql by

sudo service mysql stop

and then started lampp using:

sudo /opt/lampp/lampp start

And everything works fine

1
  • Cool! Just worked for me as well. That error gave me quite a scare, honestly! :P
    – ankush981
    Jan 22, 2014 at 16:18
3

I had similar error. Disconnect from internet, access phpmyadmin, then reconnect internet. This solved my problem.

1
  • 1
    this worked for me! thanks. I am guessing the network's firewall or something caused this issue.
    – jroi_web
    Sep 8, 2015 at 0:11
2

I found that there are some temporary log files are created in the windows temp directory. If the log file limit has exceeded and there is no more space available from windows to write in that log file, it fires an error of access denied. Clear files from the temp directory can solve it.

In windows 7, follow the process.

Run >> type %temp% and hit enter >> Select all files and delete >> Restart WAMP and access PHPMyAdmin.

1

I am also facing this issue, But disabling firewall resolved this. But any other approach to solve it ? I dont think that this would be a good solution to run mysql. but till then we can use mysql by disabling firewall.

1

Maybe mysql is not configured to accept remote connections?

try the following:

Open your my.cnf (/etc/mysql/my.cnf usually) and change the line that says

bind = 127.0.0.1

(If present) to your network ip.

Restart mysqld after that change.

1

I copied my mysql files (the whole directory structure), from one unix computer to another unix computer. Even though the mysql server was completely off, when I made the copy, I could not get it to start up on the 2nd computer.

I had an error "File ./mysql-bin.000532 not found Errorcode: 2" Since I had the whole thing backed up, I could afford to delete pieces without any impact. In other words, I can't make it any more DEAD. And I can restore any file I trashed.

From digging on the internet, I found that if I remove ib_logfile0 and ib_logfile1, mysql will attempt to recreate them from scratch. This seemed to move it along. However, it still asked for and failed to find that mysql-bin.000532. In THIS forum I see that file mysql-bin.index is just a text file holding onto all of these mysql-bin.####### files. Emptying it means I will not be looking for missing files. Great. Now it comes up fine.

But think about it. There is a reason for those files I am sure. It is holding onto changes to data. What if you had changes that were not actually dropped to disk? You would lose them. As I said at the start, this is a copy of mysql with it completely OFF. So all of MY changes are in. So I am good to go.

Last thing, I am sure this is covered in some mysql documentation somewhere. I just have not found it yet. My actions were based on guesses and experimentation.

1
  • This was the only one that worked for me. I searched for hours :O Just delete ib_logfile0 and ib_logfile1 from the data directory in your mysql install. May 21, 2014 at 16:39
1

I had the same problem, and I tried all previous suggestions, above.
Finally the problem for me, was related to the hosts file, something I had previously added trying to solve another related issue.

1

I have been through the exact same situation. Read loads of blog and posts. So far my understanding is that it happens mostly because of permission issues. Ubuntu/Linux deals directory access and their permissions very strictly.

Find out where is mysql directory is, then give it proper access right n permission. refresh you localhost/phpmyadmin it should be working now.

In my case I did following according this blog:

sudo chown -R mysql.mysql /opt/lampp/var/mysql
  • Please notice here that in the blog it says mysql directory in /var/lib/mysql
  • But actually directory in my machine was /opt/lampp/var/mysql

So directories can differ. Therefore, point out right directory and give it proper access. It should be working fine after unless there isn't any hidden error attached to it.

1

I'm assuming you faced the issue possibly because of a recent update of the database.

If that's the case, please simply do the following three steps:

  1. Disconnect from your internet.
  2. Access your MySQL offline as usual.
  3. Once you have logged in MySQL, you can reconnect to the Internet.
0

I installed MySQL stand-alone (not using any XAMPP/WAMP stack) and got this problem some time ago. I just ran the following command in windows command prompt:

C:\>"C:\mysql\bin\mysqld" --console

where "C:\mysql\" is the installation directory (adjust the path according to your own case). The

  --console

displays the process for debugging purposes.

After startup, you should see something like:

C:\mysql\bin\mysqld: ready for connections
Version: '5.7.10'  socket: ''  port: 3306

For moore, see Starting MySQL Server

0

These step worked for me:

  1. Open services
  2. Stop MySQL[version] service
  3. Open MySQL properties
  4. If you did a manual install of MySQL (ie not using xampp wamp etc.) then you may want to change startup type to automatic
  5. Go to the log in tab
  6. Select local system account
  7. Press ok
  8. Start the service again

MySQL57 properties screenshot:
MySQL57 properties screenshot

0

I'm having the same problem with Wampserver. It’s worked for me:

You must change this file: "C:\wamp\bin\mysql[mysql_version]\my.ini"

For example: "C:\wamp\bin\mysql[mysql5.6.12]\my.ini"

And change default port 3306 to 80. (Lines 20 & 27, in both)

port = 3306 To port = 80

0

When I turned off my McAfee Firewall the problem was fixed

What I need to change in McAfee settings

Firewall -> Settings -> Program Permissions -> Apache HTTP Server -> need to be set to Full or Outgoing

0

Sometimes you might have multiple webservers running i.e. apache2 and nginx concurrently on same location but different ports. I suggest stopping apache2 or nginx and then restarting the one you prefer before deleting any files.

-1

You can solve this problem by rebooting your system.

In Ubuntu you can use:

reboot
-1

What I did, is:

  1. Uninstall Wamp
  2. Delete the Wamp folder from C
  3. Reinstall Wamp again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.