xampp MySQL does not start
Asked Answered
M

13

63

I installed Xampp on Windows 7 32-bit. When I try to start MySql in XAMPP control panel (v3.2.1) I have the following message and MySql does not start.

23:02:03  [mysql]   Problem detected!
23:02:03  [mysql]   Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL"!
23:02:03  [mysql]   MySQL WILL NOT start without the configured ports free!
23:02:03  [mysql]   You need to uninstall/disable/reconfigure the blocking application
23:02:03  [mysql]   or reconfigure MySQL and the Control Panel to listen on a different port
23:02:03  [mysql]   Attempting to start MySQL service...

A similar problem was reported here but there is no working answer. When I try to install with MySql disabled, the result is that I even don't have an option even to try to run it.

I am new to Xampp and don't know where and what to look for to solve the issue

I need to run Apache and MySql with Php.

Movable answered 11/8, 2013 at 22:2 Comment(0)
K
77

You already have a version of mySQL installed on this machine that is using port 3306. Go into the most recent my.ini file and change the port to 3307. Restart the mySQL service and see if it comes up.

You also need to change port 3306 to 3307 in xampp\php\php.ini

Known answered 11/8, 2013 at 22:6 Comment(9)
Thanks. Seems to work. Is it going to be a problem later on, that I have two installations of the same MySql? I wonder if it is not better to simply remove now stand alone MySql and install xampp again?Movable
A problem? Not really... more of an annoyance. I think you should remove one or the other to be safe. All of the standard mySQL interfaces are going to default to port 3306, as is the PHP code unless you specify otherwise.Known
Not working : I tried to edit & it is not saving it ! it is saying access is deniedOrvalorvan
First run Notepad as Administrator and then open the file and see if it helps.Cellini
Most recent my.ini is which? I have a tons of mysql ini files and I dont know which one is it.Dougdougal
@Čamo - That's what timestamps are for.Known
i chage to 3307, and in my xampp control apear "port 3307" (instend of 3306), however , still same error apearGamaliel
This is not necesserily true - if you see this message after UPGRADING Xammp, please see my reply below.Quern
didn't worked out for meBenil
A
39

You have two versions of mysql using the same port 3306. Change the port by:

  1. Stop the xampp server, if it is already running.
  2. Edit the value to "port" in xampp/mysql/bin/my.ini

Here:

# The following options will be passed to all MySQL clients
[client]
Password = your_password   
port =  3306  #--->  3307  
socket =  "/ xampp / mysql / mysql.sock"

and also here:

The MySQL server 
[ mysqld ] 
port =  3306  #--->  3307 
socket =  "/ xampp / mysql / mysql.sock"
2. Start mysql service
Applesauce answered 26/5, 2014 at 6:59 Comment(0)
G
11

I found out that re-installing Xampp as an administrator and running it as an Administrator worked.

Greatest answered 30/11, 2013 at 9:48 Comment(2)
Thanks to this idea, I re-started my XAMPP as Administrator and that fixed the issueGasp
thanks brother running as an administration works for me but now it is getting Access Denied for phpmyadmin. btw thanks again for answer.Lesterlesya
C
3

Try this: really quick + worked for me:

  1. Open Task Manager > Services Tab
  2. Find "mysqlweb" service > right-click it to stop service
  3. Launch Xampp again

ps: excuse image below for different language :)

enter image description here

Clearway answered 8/1, 2017 at 19:20 Comment(1)
Did not found mysqlweb but found other mysql services, afteer termination I opened xampp as admin and it worked ;)Concertino
Q
3

Google Brings me here. The favourite answers don't help me. I've now solved it, so maybe this will help someone else. Problem: after UPDATE of XAMPP to a new version I get the message "MySQL WILL NOT start without the configured ports free!".

However, I only have 1 instance of mysqld running.

It seems that the control panel is not as clever as it looks. As far as I can tell, the single instance of mysqld is the new one i've just updated to, but running as a 'service'. The control panel then tries to start it, and instead of realising its already running, It assumes its another service and reports the error.

Probable cause: The uninstaller failed to remove the autostart property from the mysql service, so the new instal picked it up.

Solution:
open the Xammpp Control Panel and click on the Services Button on the right. This will open the services control panel. Look for mysqld in the list of running processes, right-click it to get the properties and change the startup type to "Manual". you might as well do the same for Apache2 while you're here. Apply changes and Close the services control panel.

Now click the Config Button on xampp control panel, uncheck The Mysql (and Apache) Autostart features.

Reboot the machine. You should now be able to start / stop Mysql & Apache without any error messages. If this works, use the Xampp Control panel as usual to start/stop add service or add autostart as normal. No need to mess with any ports or config files.

Quern answered 7/6, 2018 at 15:43 Comment(0)
T
2

If there are two instances of MySql it's normal that it gives such an error if they both run at the same time. If you really need 2 servers, you must change the listening port of one of them, or if you don't it's probably better to simply uninstall one of them. This is so regarless of MySql itself, because two programs cannot listen on the same port at the same time.

Turgeon answered 11/8, 2013 at 22:25 Comment(0)
O
1

You need to uninstall/disable/reconfigure the blocking application that is using the port 3306. But, if for some reason, you can't do the above maybe because you need the other application too, then follow these steps to change the MySQL port to 3307.

  1. Stop the Apache Server from XAMPP Control Panel (if running)
  2. Now open XAMPP Control Panel => Config (Top Right) => MySQL and change the Main Port to 3307 => Save => Save
  3. Click Config of MySQL (From Control Panel only) => my.ini and then Change all the occurrences of 3306 to 3307 (Search using ctrl + F and replace all)
  4. Click Config of Apache (From Control Panel only) => config.inc.php and then search for the line: $cfg['Servers'][$i]['host'] = '127.0.0.1'; (present at 27th line in my file). Now add this below the line you found (at line 28 according to my file): $cfg['Servers'][$i]['port'] = '3307';

Now, you are good to go. Also note that you would have to change port for all your projects to 3307 for them to work properly. For eg: from $servername = "localhost"; to $servername = "localhost:3307"; in the database config file of your project.

I hope this works for you too.

Obtund answered 6/8, 2021 at 19:16 Comment(0)
T
0

Same issue on macOS and got it fixed by running the same installer again.

Whereas I COULD NOT get it fixed by

  1. Changing port
  2. Rebooting XAMPP
  3. Restarting system

Note: Make sure to select 'XAMPP Core Files' component while running the installer as by default it is not selected.

Though re-running the installer is not smart option when one has to do it every now and then. My installer is xampp-osx-7.0.13-1-installer.dmg

Update: I've got my MAMP working with this simple solution here. So, same should work for XAMPP.

Transcalent answered 16/1, 2017 at 19:3 Comment(0)
O
0

If you have previously installed MySQL Workbench the problem is that another MySQL instance is running at 3306 port.

So uninstall MySQL and XAMPP and after that, reinstall only XAMPP.

This worked for me.

Overhang answered 9/4, 2018 at 12:47 Comment(0)
R
0

So if you are on a Windows machine, you can open the task manager. Check the processes list, and delete the mysqlId from it. Restart the xampp. It will work fine.

Rowell answered 17/7, 2021 at 11:59 Comment(0)
J
0

My fix was to stop MySQL57 in services, Xampp now starts/stops Apache/MySQL as expected.

Jennine answered 12/2, 2022 at 12:27 Comment(0)
S
0

I tried all of the most liked answers, but they either didn't work or had some errors or they were difficult.

I think the best and simplest way is to change the default port in XAMPP. To do this:

1- Open XAMPP as an administrator.

2- Stop the MySQL service.

3- Click on the "Config" button located at the top right.

4- Click on "Service and Port Settings."

5- Select the MySQL tab.

6- Change the main port from 3306 to 3307.

7- Navigate to xampp/mysql/bin/my.ini.

8- Change the port from 3306 to 3307 in two lines as follows:

Firstly:

# The following options will be passed to all MySQL clients
[client]
Password = your_password   
port =  3306  #--->  3307  
socket =  "/ xampp / mysql / mysql.sock"

Secondly:

The MySQL server 
[ mysqld ] 
port =  3306  #--->  3307 
socket =  "/ xampp / mysql / mysql.sock"

9- Return to XAMPP and start the MySQL service.

Sight answered 4/5, 2024 at 20:8 Comment(0)
D
-1

The is a simple and faster way to solve the problem.

You don't need to open a services or write any cmd code just follow my steps:

  1. from XAMPP control panel click Explorer button

  2. from directory find mysql_stop.bat file and run it.

Thats all!! super easy.

Refresh your netstat list, you will see that it has gone.

please make it as best answer.

Dysphemism answered 26/12, 2019 at 15:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.