Pureinfotech Forums

XAMPP - MySQL would not connect on Windows 10

I am trying to install XAMPP on my Windows 10 machine.
I have read your article How to install and configure XAMPP on Windows 10 .
Here is my problem. After installing and changing (the Bitnami version), I was told by Microsoft to “take ownership” to change the my.ini file. Which I did. Now I can run Apache and MySQL, but when try to download and use apps like Drupal and Wordpress, it says MySQL cannot connect because “the local Machine is actively using it”. I tried the “admin” button and this is what I got:

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).

Followed by:

mysqli_real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it.

Any ideas how I can fix the problem?

It’s likely that MySQL is using a port already being used by another application.

If that’s not the case:

  1. You can try locating the mysql folder in your xampp installation C:\xampp\mysql\data.
  2. Stop XAMPP services first.
  3. Backup these files ib_logfile0 and ib_logfile1 in data folder elsewhere.
  4. Delete the ib_logfile0 and ib_logfile1 files from the “data” folder.
  5. Restart the XAMPP the services.

Thank you Mauro,
It seems I got it sorted. Now I just need to succeed installing Drupal and Wordpress on the local server.

1 Like

Did you fix it or it fixed itself?
If you did something it’ll be interesting to know :slightly_smiling_face:

Interestingly, it fixed itself. I uninstalled everything, restarted my computer and then reinstalled.
It was late, so I jut left it to deal with today. This morning it worked.
I also found out, that installing the Bitnami stacks for Drupal and Wordpress worked when I did not open XAMPP and start Apache and MySQL before in installed them.
They work fine, although, when I checked the XAMPP control panel afterwards, it couldn’t start Apache or MySQL. So, not too sure what happened there. Maybe only one app at a time?

1 Like

It was probably the ports. A required port maybe was in use when Bitnami was running.
Thanks for the update though, good to hear things are working.

Yes, I think you may have a point. The other interesting thing I discovered yesterday, was that I can run both Wordpress and Drupal, but when I start up the control panel in XAMPP it struggles. Sometimes it runs Apache and MySQL and other times not. No problem with accessing the two apps I want to test though.

1 Like