MySQL Database won't start in XAMPP Manager-osx

243,113

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.

  1. Click on Manage Servers
  2. Select MySQL Database
  3. Click on Configure on your right
  4. Change your port number to 3307
  5. Click OK
  6. 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:

  1. sudo killall mysqld
  2. sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Share:
243,113

Related videos on Youtube

nitrous
Author by

nitrous

I love technology and am currently learning web design

Updated on June 11, 2021

Comments

  • nitrous
    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
      Hammad Khan over 10 years
      When did the problem start?
    • evan.stoddard
      evan.stoddard over 10 years
      You can also go to activity monitor in the utilities folder and kill the process there.
    • evan.stoddard
      evan.stoddard over 10 years
      I would also recommend backing up your web directory folder and re-install xampp.. That works for me.
    • Hammad Khan
      Hammad Khan over 10 years
      What do you think caused the problem?
    • Md. Sajedul Karim
      Md. Sajedul Karim about 8 years
      I have installed another mysql into my mac. I stopped that one then it solved.
    • Matt
      Matt over 3 years
      In 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
    Charles Wyke-Smith over 9 years
    This works when manager-osx can't start the mySQL database on your localhost
  • auspicious99
    auspicious99 over 9 years
    Awesome, 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
    Geoffrey Hale about 9 years
    Didn't work for me: Starting MySQL ............................................................‌​....................‌​....................‌​. ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/gmac.local.pid).
  • Krutarth Patel
    Krutarth Patel almost 9 years
    ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/testingAccounts-Ma‌​c.local.pid).. what to do
  • LucaM
    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
    LucaM almost 9 years
    @iKrutarth look at my comment at benshittu's answer, maybe it'd be helpful also for you
  • Adrian
    Adrian almost 9 years
    This 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
    azwar_akbar over 8 years
    Absolutely helped me. Thanks.
  • Henrik
    Henrik over 8 years
    Duplicate answer. An older version of this answer already exists.
  • Jasper
    Jasper over 8 years
    Worked for me! Perfect!
  • Abdullah Rasheed
    Abdullah Rasheed over 8 years
    so does that mean you do chmod 444 my.cnf in terminal?
  • Robert Cabri
    Robert Cabri over 7 years
    Thnx. 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
    Sasha Chirico over 7 years
    Instead for me, this code-line works every time when MySQL doesn't start
  • Robert Cabri
    Robert Cabri over 7 years
    Not working. Keeps giving me an error. No message. Just "Error!"
  • Robert Cabri
    Robert Cabri over 7 years
    Reinstall XAMPP gives me a bigger problem. Can't access the table data anymore
  • Shubha S
    Shubha S about 7 years
    I treid changing the port and restarting the manager worked for me.Thank you.
  • Jimmy Adaro
    Jimmy Adaro almost 7 years
    Worked for me! – Don't worry if sudo killall mysqld throws something like process not found.
  • Greg K.
    Greg K. over 6 years
    removing tc.log fixed this problem for me
  • Bonsai
    Bonsai over 6 years
    Perfect man, I changed port number from 3306 to 3307. Thank you !
  • bharat
    bharat about 6 years
    I 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
    Admin almost 6 years
    what 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
    Ramv V almost 6 years
    I run this command sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start it's working for me.
  • Mohamed Daaniyaal
    Mohamed Daaniyaal over 5 years
    Changing the port of XAMPP MySQL to 3307 works fine!
  • Jashan PJ
    Jashan PJ over 5 years
    Worked the Changing port number to 3307
  • nerdess
    nerdess about 4 years
    seems 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
    Splambo over 3 years
    I 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
    Olly over 3 years
    Thanks This really worked for me on XAMPP version 7.3.19
  • Omar
    Omar over 2 years
    HA! Changing the port number worked for me. thanks! :fire:
  • Adan Vivero
    Adan Vivero almost 2 years
    THANKS! this was the issue that I was having for 3 years.
  • Adan Vivero
    Adan Vivero almost 2 years
    Be sure to check out @Geoffreey Hale 's post below for the { sudo killall mysqld }