I just uninstalled MySQL server, restarted my laptop and reinstalled MySQL server on Windows 8.1.
When I tried to configure it, it said "Port 3306 is already in use" (or something). I know I can use another port number, but I wanted to know how to set 3306 port free and use it.
Actually the port should not be in use anymore.
Did you try out who uses that port? try netstat -ao. Will return you a list of opened ports plus the process id of the program that uses that. You can check which program it is in Task Manager.
Obviously there must be some process binding to the port.
Have a look at this answer on a similar topic to find out which process it is:
https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows
Once you have the info in hand you can deal with the process - whether it is a remainder of the old mysql installation or something else.
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.
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
You have two versions of mysql using the same port 3306.
Change the port by:
Stop the xampp server, if it is already running.
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
I found out that re-installing Xampp as an administrator and running it as an Administrator worked.
Try this: really quick + worked for me:
Open Task Manager > Services Tab
Find "mysqlweb" service > right-click it to stop service
Launch Xampp again
ps: excuse image below for different language :)
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.
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.
Same issue on macOS and got it fixed by running the same installer again.
Whereas I COULD NOT get it fixed by
Changing port
Rebooting XAMPP
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.
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.
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.
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.
Stop the Apache Server from XAMPP Control Panel (if running)
Now open XAMPP Control Panel => Config (Top Right) => MySQL and change the Main Port to 3307 => Save => Save
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)
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.
My fix was to stop MySQL57 in services, Xampp now starts/stops Apache/MySQL as expected.
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:
from XAMPP control panel click Explorer button
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.
I've played a little with php and data bases a few weeks ago and it worked perfectly. Now, when I tested the same thing again, I realized that it is not runnable anymore. More exactly, when I have to access the data base, I get the following type of notice:
Warning: mysqli_connect() [function.mysqli-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in E:\wamp\www\test\login.php on line 18
When I try to open http://localhost/phpmyadmin/ I get a blank screen
Please give me the possible explanations
You probably have another application using port 3306, another MySQL running perhaps?
The Possible explanation is
i suspect you have installed and uninstalled wamp? in that case you need to check you driver/etc/.hosts file under system32 ("Google it for exact path") :) and you have to make sure there exist only one value for
127.0.0.1 localhost
As it said above you need to check your running port has already used by another instance by checking
netstat -a and see if 3306 is Listening
Check on windows services that MySQL ,Apache are running or able to run automatically or manually from the service
suggest uninstall properly ==> delete all inside the wamp folder except www --takecare
I recently installed the latest Zend Server CE 5.6.0 SP4 on Windows 7 complete with php and mysql.
At first the Zend Server wouldn't work as I think there was some conflict with ports with my Zonealarm firewall. I deactivated the firewall, rebooted tried again and it worked so then reactivated the firewall. Not sure if the firewall has now found an alternative port. I don't really know much about those things. I think the ports it's on are 80 and 10061 but not too sure.
Anyway, I'm working through a PHP/Mysql book where it shows how to connect to the mysql database using the command line without a password. The first suggestion was:
"C:\Program Files (x86)\Zend\MySQL51\bin" -u root
That didn't work so I manually navigated to the MySQL51\bin folder then typed mysql.exe -u root. It then gave an error Error 2003 (HY000): Can't connect to MySQL on 'localhost' 10061
I tried turning the firewall off and trying again but still no luck.
Any ideas or suggestions would be appreciated.
Thanks for any help
Gary
Although this is an old post, it was one of the top hits searching for this problem. I found a solution that works on current MySql55 installation under ZEND. In the Zend installation folder (on Windows, hopefully same on others), Zend\MySql55\bin there's a file "MySQLInstanceConfig.exe".
If you run that, it let's you force a change to the password, and then (for me) the command line worked.
I am having window 7 as a operating system in the production machine where i am trying to use MySQL server 5.0 as a database. But i am unable to configure MySQL on my production machine. Following is the error i am receiving.
The security setting could not be applied to the database because the connection has failed with the following error:
Error no. 2003
Can't connect to MySQL server on localhost (10061).
The message also prompts that you need to open TCP 3306 port to resolve this issue, i checked it and found that TCP 3306 port is already opened and state is listening.
This is my 'netstat -an' command result -
Proto LocalAddress ForeignAddress State
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
It means TCP at 3306 is open. Can anyone please tell me the solution of this problem. However i am able to install and configure the same MySQL Server setup in window xp. I tried google as well and found a lot of blogs but none is of use.
Thanks a lot.
Change
host: localhost
to
host: 127.0.0.1
This is likely caused by the way your database is being resolved.
have you checked whether the port 3036 is already in use by another application?
Have you checked whether a telnet hostname 3036 works on the local MySQL server and also on the remote machine?
First check in the system, MySQL services is in running condition or not.
look out on path of services go to right click on My Computer > manage > Services and Application > Services and check MySQL service status is started or not. Otherwise right click on service and start to service.
I hope this will help you.
I didn't find the MySQL services even after solving the problem.
I just run the mysqld as administrator and the problem is solved. So, simple but It took me 3 hours to find the solution.
The problem was rsolved.
The MySQL was not running in the Services section of Settings. Because XAMMP had disconnected the already running application in the background.