MySQL does not start when upgrading OSX to Yosemite or El Capitan

Adam_G picture Adam_G · Sep 21, 2014 · Viewed 109.8k times · Source

I know similar questions exist, such as MySQL with MAMP does not work with OSX Yosemite 10.10. However, I do have MAMP, nor XAMPP installed on my computer.

When I try to start mySQL from the PrefPane, nothing happens.

When I try to start mqSQL from the command line via sudo /usr/local/mysql/support-files/mysql.server start I get:

Starting MySQL . ERROR! The server quit without updating PID file (/usr/local/mysql/data/adamg.local.pid).

Any and all help would be appreciated. I can supply any file output necessary.

Answer

Tommy King picture Tommy King · Feb 5, 2015

Open a terminal:

  1. Check MySQL system pref panel, if it says something along the line "Warning, /usr/local/mysql/data is not owned by 'mysql' or '_mysql'

  2. If yes, go to the mysql folder cd /usr/local/mysql

  3. do a sudo chown -R _mysql data/

  4. This will change ownership of the /usr/local/mysql/data and all of its content to own by user '_mysql'

  5. Check MySQL system pref panel, it should be saying it's running now, auto-magically. If not start again.

  6. Another way to confirm is to do a

    netstat -na | grep 3306

It should say:

tcp46      0      0  *.3306                 *.*                    LISTEN

To see the process owner and process id of the mysqld:

ps aux | grep mysql