MySQL Database won't start in XAMPP Manager-osx
Solution 1
This should work:
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Solution 2
Minimal Guide
1.
sudo killall mysqld
2. manager-osx > start mysql
If that didn't work...
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Google the error...
Examples:
Error:
ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/<computername>.local.pid)
My Solution:
In /Applications/XAMPP/xamppfiles/etc/my.cnf
change user = <uid>
s that <uid>
is uid
from id
command.
$ id
uid=...
$ vim /Applications/XAMPP/xamppfiles/etc/my.cnf
...
Solution 3
If these commands don't work for you:
sudo killall mysqld
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Try this:
For XAMPP 7.1.1-0, I changed the port number from 3306 to 3307.
- Click on Manage Servers
- Select MySQL Database
- Click on Configure on your right
- Change your port number to 3307
- Click OK
- Close your Control Panel and relaunch it.
You are now good to go.
Solution 4
check the err log on your /Applications/XAMPP/xamppfiles/var/mysql/ with filename like your_machine_name.local.err, if you find something like: "Attempted to open a previously opened tablespace. Previous tablespace ... uses space ID"
the following works for me:
edit file:
/Applications/XAMPP/xamppfiles/etc/my.cnf
find the [mysqld] section, add one line:
innodb_force_recovery = 1
then run
sudo /Applications/XAMPP/bin/mysql.server start
everything is ok again.
and then the last step:
edit the my.cnf again and remove the line you just added :
innodb_force_recovery = 1
and restart mysql again. Otherwise all your tables will be read only
Solution 5
Try running these two commands in the terminal:
sudo killall mysqld
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Related videos on Youtube
Comments
-
nitrous almost 3 years
I downloaded XAMPP about a month ago and it was working just fine. Today I installed a voice recognition software and then restarted my computer. Ever since, MySQL won't start in my manager-osx application. It doesn't throw me an in the application log. This is what it says:
Stopping all servers... Stopping Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped Stopping ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped Restarting all servers... Starting MySQL Database... Starting Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started Starting ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd started
Both my ProFTPD and my Apache Web Server are running. MySQL isn't. When I go to phpmyadmin, it throws me this error message.
#2002 - No such file or directory The server is not responding (or the local server's socket is not correctly configured).
Please help me. I have no idea what to do.
UPDATE:
After looking around the internet a bit, I found a similar problem a user had with MAMP, another user recommended killing the mysql process, what ever that means. Could this be a fix to my problem?
UPDATE 2:
I found the answer to my problem but I can't answer it yet. So here's the answer:
1) Open terminal and type
sudo su
and then put in your password
2) Then type
ps aux | grep mysql
(just copy and paste this)
3) You will need to get the process id of mysql. There should be number near the top, something like 739 or 8827
4) Kill the process using
kill -9 {process id}
this should look something like this: kill -9 739
5) Restart MySQL in manager-osx
-
Hammad Khan over 10 yearsWhen did the problem start?
-
evan.stoddard over 10 yearsYou can also go to activity monitor in the utilities folder and kill the process there.
-
evan.stoddard over 10 yearsI would also recommend backing up your web directory folder and re-install xampp.. That works for me.
-
Hammad Khan over 10 yearsWhat do you think caused the problem?
-
Md. Sajedul Karim about 8 yearsI have installed another mysql into my mac. I stopped that one then it solved.
-
Matt over 3 yearsIn case my id is none of the above, you didn't share which column that contains the actual id? Is it the first one 4401? Or the fifth one 688?
-
-
Charles Wyke-Smith over 9 yearsThis works when manager-osx can't start the mySQL database on your localhost
-
auspicious99 over 9 yearsAwesome, this works! Am curious, though, why the manager-osx start mySQL, and if I'll have to sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start ? Or can the manager-osx script be corrected?
-
Geoffrey Hale about 9 yearsDidn't work for me:
Starting MySQL ..................................................................................................... ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/gmac.local.pid).
-
Krutarth Patel almost 9 yearsERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/testingAccounts-Mac.local.pid).. what to do
-
LucaM almost 9 years@GeoffreyHale and everyone else facing this problem: look at your log (/Applications/XAMPP/xamppfiles/var/mysql/YOURNAME.err) and probably you'll discover what caused the error. Mine was
[ERROR] InnoDB: Unable to lock /Applications/XAMPP/xamppfiles/var/mysql/ibdata1, error: 35
and furthermore[Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
Heck! It was right! Kill the mysqld process, type benshittu's command and it should work. -
LucaM almost 9 years@iKrutarth look at my comment at benshittu's answer, maybe it'd be helpful also for you
-
Adrian almost 9 yearsThis did not work for me. What version of XAMPP are you using when you do that? I'm on 1.8.3-4 for compatibility reasons for an application.
-
azwar_akbar over 8 yearsAbsolutely helped me. Thanks.
-
Henrik over 8 yearsDuplicate answer. An older version of this answer already exists.
-
Jasper over 8 yearsWorked for me! Perfect!
-
Abdullah Rasheed over 8 yearsso does that mean you do
chmod 444 my.cnf
in terminal? -
Robert Cabri over 7 yearsThnx. This helped a lot. Found the error log and saw innodb was causing the problem. It now restarts, but now can't access the databases anymore. So there is bigger underlying problem :(. I think it has something to do with updating Mac OSX. This is not the first time. Only reinstalling xampp won't fix it either. The databases are corrupt....
-
Sasha Chirico over 7 yearsInstead for me, this code-line works every time when MySQL doesn't start
-
Robert Cabri over 7 yearsNot working. Keeps giving me an error. No message. Just "Error!"
-
Robert Cabri over 7 yearsReinstall XAMPP gives me a bigger problem. Can't access the table data anymore
-
Shubha S about 7 yearsI treid changing the port and restarting the manager worked for me.Thank you.
-
Jimmy Adaro almost 7 yearsWorked for me! – Don't worry if
sudo killall mysqld
throws something likeprocess not found
. -
Greg K. over 6 yearsremoving tc.log fixed this problem for me
-
Bonsai over 6 yearsPerfect man, I changed port number from 3306 to 3307. Thank you !
-
bharat about 6 yearsI have trying same thing but not working for new xampp 7.2.2: Following error message received (I have question blocked so I can't ask as new question on stackoverflow)
Starting MySQL .2018-03-06 11:21:32 3610 mysqld_safe Logging to '/Applications/XAMPP/xamppfiles/var/mysql/Bharats-iMac.local.err'. 2018-03-06 11:21:32 3610 mysqld_safe Starting mysqld daemon with databases from /Applications/XAMPP/xamppfiles/var/mysql ERROR!
-
Admin almost 6 yearswhat to do if we get error in terminal as: 7548 mysqld_safe Starting mysqld daemon with databases from /Applications/XAMPP/xamppfiles/var/mysql ERROR!
-
Ramv V almost 6 yearsI run this command sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start it's working for me.
-
Mohamed Daaniyaal over 5 yearsChanging the port of XAMPP MySQL to 3307 works fine!
-
Jashan PJ over 5 yearsWorked the Changing port number to 3307
-
nerdess about 4 yearsseems like "sudo killall mysqld" is not catching all running mysql instances. i had mysql running with homebrew so check "brew services" and if the mysql process is running there stop it with "brew services stop mysql"
-
Splambo over 3 yearsI also had just ERROR! and nothing else. I went with this thread, and then did the sudo killall steps. I didn't have to reinstall - osx el capitan
-
Olly over 3 yearsThanks This really worked for me on XAMPP version 7.3.19
-
Omar over 2 yearsHA! Changing the port number worked for me. thanks! :fire:
-
Adan Vivero almost 2 yearsTHANKS! this was the issue that I was having for 3 years.
-
Adan Vivero almost 2 yearsBe sure to check out @Geoffreey Hale 's post below for the { sudo killall mysqld }