XAMPP - MySQL shutdown unexpectedly - php

I installed XAMPP on Windows 8 (64bit). In XAMPP Control Panel i can't start mySQL. I changed the port of mySQl in "C:/xampp/mysql/bin/my.ini" from 3306 to 3307 according to that link:
xampp MySQL does not start
now the code in "my.ini" changed to:
[client]
# password = your_password
port = 3307
socket = "C:/xampp/mysql/mysql.sock"
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port= 3307
socket = "C:/xampp/mysql/mysql.sock"
Now it still gives that error:
11:31:48 AM [mysql] Attempting to start MySQL service...
11:31:56 AM [mysql] Status change detected: running
11:32:01 AM [mysql] Status change detected: stopped
11:32:01 AM [mysql] Error: MySQL shutdown unexpectedly.
11:32:01 AM [mysql] This may be due to a blocked port, missing dependencies,
11:32:01 AM [mysql] improper privileges, a crash, or a shutdown by another method.
11:32:01 AM [mysql] Press the Logs button to view error logs and check
11:32:01 AM [mysql] the Windows Event Viewer for more clues
11:32:01 AM [mysql] If you need more help, copy and post this
11:32:01 AM [mysql] entire log window on the forums
I deleted "ibdata1" file in "C:\xampp\mysql\data".
also stopped mysql56 service.
Any help is appreciated. Thanks

Check the error logs to view more details on the subject. Check that mysql and mysqli port options in my.ini and php.ini and in config.inc.php match and are 3307.
In case MySQL Server has crashed you might want to take a look at Forcing InnoDB Recovery
In addition take also a look at this solution in case it is a 3rd party software issue.

Just like #Peter said, you need to change that file configuration.
Try to change this in your xampp folder ex: C:\xampp\php\php.ini:
mysql.default_port=3307
mysqli.default_port=3307
And change this parameter in your xampp folder ex: C:\xampp\mysql\bin\my.ini :
[client]
# password = your_password
port = 3307
socket = "C:/xampp/mysql/mysql.sock"
[mysqld]
port= 3307

To fix this issue,
Right click and open task manager
kill process "mysqld".
Open Xampp and start MySQL.
This really works!!
References:
https://www.youtube.com/watch?v=jcaqDv0f8K4

Just open task manager and forcefully end the task named mysqld.exe. And then try once again.

Related

Apache Service detected with wrong path(xampp)

I have xampp on my C Drive and it was deleted from my computer, i tried to install it again on the C drive but i failed, so i ended up installing it on my E drive.
And when i open it it gives me this error messages.
2:52:51 AM [Apache] Apache Service detected with wrong path
2:52:51 AM [Apache] Change XAMPP Apache and Control Panel settings or
2:52:51 AM [Apache] Uninstall/disable the other service manually first
2:52:51 AM [Apache] Found Path: "C:\xampp\apache\bin\httpd.exe" -k runservice
2:52:51 AM [Apache] Expected Path: "e:\xampp\apache\bin\httpd.exe" -k runservice
2:52:51 AM [mysql] MySQL Service detected with wrong path
2:52:51 AM [mysql] Change XAMPP MySQL and Control Panel settings or
2:52:51 AM [mysql] Uninstall/disable the other service manually first
2:52:51 AM [mysql] Found Path: C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
2:52:51 AM [mysql] Expected Path: e:\xampp\mysql\bin\mysqld.exe --defaults-file=e:\xampp\mysql\bin\my.ini mysql
2:52:51 AM [mysql] Problem detected!
2:52:51 AM [mysql] Port 3306 in use by "C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql"!
2:52:51 AM [mysql] MySQL WILL NOT start without the configured ports free!
2:52:51 AM [mysql] You need to uninstall/disable/reconfigure the blocking application
2:52:51 AM [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
I'm not an expert but if I was in your situation I would listen to what te log says..
1- Easy but pain in the ass for further configuration: Change the port in your E: configurations files of mysql etc...
2- Try to delete the path that your log is seeing for the older installation also check if you can modify the mysql service that is running on port 3306 or delete that service too (it should be re-configured) the next time you'll start XAMPP. Don't forget to restart your php and mysql if you try this..
3- Easiest: delete/uninstall both of your XAMP path location and every mysql service that might run and do a complete instalatio again for XAMPP...
ps: Sorry for the format of that text I never comment on stackoverflow my bad ;)

MySQL shutdown unexpectedly xampp

My apache is running properly but mysql server is showing this error
Error: MySQL shutdown unexpectedly.
[mysql] This may be due to a blocked port, missing dependencies,
[mysql] improper privileges, a crash, or a shutdown by another method.
[mysql] Press the Logs button to view error logs and check
[mysql] the Windows Event Viewer for more clues
[mysql] If you need more help, copy and post this
[mysql] entire log window on the forums
I tried deleting ibdata1, ib_logfile0, ib_logfile1, ib_logfile101 files, but it didn't workout. Help me to solve this problem.
I have faced the same issues today.
Error: MySQL shutdown unexpectedly.
7:56:51 PM [mysql] This may be due to a blocked port, missing dependencies,
7:56:51 PM [mysql] improper privileges, a crash, or a shutdown by another method.
7:56:52 PM [mysql] Press the Logs button to view error logs and check
7:56:52 PM [mysql] the Windows Event Viewer for more clues
7:56:52 PM [mysql] If you need more help, copy and post this
7:56:52 PM [mysql] entire log window on the forums
Solution:
Stop the Apache Service, then
Copy all files from xampp\mysql\backup, and paste all files inside xampp\mysql\data.
Start Apache
...and MySQL is working perfectly.
I faced the same problem.
22:41:18 [mysql] Error: MySQL shutdown unexpectedly.
22:41:18 [mysql] This may be due to a blocked port, missing dependencies,
22:41:18 [mysql] improper privileges, a crash, or a shutdown by another method.
22:41:18 [mysql] Press the Logs button to view error logs and check
22:41:18 [mysql] the Windows Event Viewer for more clues
22:41:18 [mysql] If you need more help, copy and post this
22:41:18 [mysql] entire log window on the forums
But it didn't work even after copying all files from xampp\mysql\backup, and pasting them inside xampp\mysql\data Or when I deleted ibdata1 file.
So, I went through this link.
Free the port number
Stop your Apache module in xampp control panel.
Open command prompt and Run as Administrator
Type “netstat -ano” in the cmd prompt. This will show all the port connections in your network.
netstat -ano
Now find your port number and use it in the find string. In my case, it is 3306.
Type “netstat -ano | findstr 3306” in cmd prompt and hit enter.
netstat -ano | findstr 3306
Find the listening id of 3306. In my case, 5224 is my listening id.
Kill that process id with “taskkill /PID 6204 /F“.
taskkill /PID 5224 /F
SUCCESS: The process with PID 5224 has been terminated. will be the output.
Restart the xampp Server.
And it worked!
[mysql] Press the Logs button to view error logs and check
[mysql] the Windows Event Viewer for more clues
We could use this information to help you out.
Possibilties:
incorect config - try to restore some known good config blocked port - quite often its skype(especially older versions of skype), try changing MySQL port

Xamp - mysql (3306 error)

Problem detected!
14:26:36 [mysql] Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" xxx (PROJECT NAME)"!
14:26:36 [mysql] MySQL WILL NOT start without the configured ports free!
I can't shake this error. Xamp Apache runs great, but can't figure out how to get mysql running.
I tried:
Change php.ini:
mysql.default_port=3307
mysqli.default_port=3307
and my.ini:
[client]
# password = your_password
port = 3307
socket = "C:/xampp/mysql/mysql.sock"
[mysqld]
port= 3307
I don't want to uninstall Mysql workbench (as it has important dbs)
Additional information (I've Installed mysql workbench - not sure if this helps or not)
You could use netstat -lp | grep 3306 to find out what program is already listening on port 3306 (you should see PID/Program name in last column) and stop that (maybe mysql is already running?).
Alternatively you could start the newly installed server on a different port. (edit my.cnf and change the default port there)

MySQL won't start on xampp (Windows)

This problem started when I didn't properly hibernate my laptop. Every time I open xampp, I can't start MySQL. I searched for online answers but nothing happened. I tried changing the port from 3306 to 3307 to 80, still nothing happened.
So I uninstalled xampp and install it again. After installing, I tried to start Apache and MySQL. Worked fine with Apache but on MySQL, I got this error log:
4:52:15 PM [mysql] Error: MySQL shutdown unexpectedly.
4:52:15 PM [mysql] This may be due to a blocked port, missing dependencies,
4:52:15 PM [mysql] improper privileges, a crash, or a shutdown by another method.
4:52:15 PM [mysql] Press the Logs button to view error logs and check
4:52:15 PM [mysql] the Windows Event Viewer for more clues
4:52:15 PM [mysql] If you need more help, copy and post this
4:52:15 PM [mysql] entire log window on the forums
It's usually because of Skype (or any other program that uses MySql port). Go to Skype Options > Advanced > Connection type in alternative port (e.g. 42795) and uncheck "Use port 80 and 443..."

MySQL startup error - port is already in use

I get the following error while trying to start XAMPP:
12:34:26 PM [mysql] Attempting to start MySQL service...
12:34:38 PM [mysql] Problem detected!
12:34:38 PM [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"!
12:34:38 PM [mysql] MySQL WILL NOT start without the configured ports free!
12:34:38 PM [mysql] You need to uninstall/disable/reconfigure the blocking application
12:34:38 PM [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
12:34:38 PM [mysql] Attempting to start MySQL service...
The log cleraly states that another application is listening on port 3306, so it is not possible to start MySQL since 3306 is the configured port for it (default port for MySQL connections). This application that already listens on por 3306 is another instance of MySQL that's probably configured to start automatically.
If you are using Windows, click the Start button, then Execute, then type services.msc and press [Enter]. Look for the running MySQL service, stop it, and configure it to prevent its launching on system startup. After that you should start XAMPP normally.
open xampp control panel.
click on "config" button.
click on "service and port settings".
click on "mysql" tab.
change the value labeled "Main Port" to 3307
So, mysql is listening 3306 port by default. According to your error,some service has already used it.
Depends on your OS,check who are using it. For example for netstat -lp | grep 3306, you can close this service and restart your mysql or change to another port OR you an change mysql default port to listen in your my.cnf file.
may be you have previously installed xampp app and left in before complete installation and then reinstalled it before uninstalling previous one just uninstall privious one or uninstall both and reinstall
Well my friend told me to reinstall xampp in C drive and it did worked but after some time i was facing same problem again so i followed this steps hope it will be helpfull.
Open cmd as administrator
If there's nothing important running on port number 3306 kill that process.
enter image description here
Follow this steps:
(In case photo have any error)
after opening cmd as administer run command
netstat -ano |findstr 3306
Then observe the PID at last column if there is only one process running shut it down.
taskkill /F /PID portidnumber
In case you get error even after doing that try to do follow the steps here:
I experienced that if we try to stop mysql before apache it is giving error.
So when you go to stop process or server stop apache first and then mysql.
And don't shutdown xampp without stopping any server
(I found this by web search and some try and error and it's working for me at least)

Categories