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

I know that similar questions exist, for example, MySQL with MAMP does not work with OSX Yosemite 10.10 . However, I have MAMP, and XAMPP is installed on my computer.

When I try to start mySQL from 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 Starting MySQL . ERROR! The server quit without updating PID file (/usr/local/mysql/data/adamg.local.pid).

Any help would be greatly appreciated. I can provide any necessary file.

+65
mysql osx-yosemite macos
Sep 20 '14 at 23:25
source share
18 answers

Solved by installing the latest version of mySQL, following the instructions here http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/

EDIT
As Yosemite becomes more popular, more people come across this question. The answer above is related to updating MySQL, so that it works. The answer related to @doc in the comments is that MySQL starts automatically. These are two separate issues.

+25
Sep 20 '14 at 23:43
source share

Open a terminal:

  • Check the MySQL system preset panel if it says something on the line "Warning, / usr / local / mysql / data does not belong to" mysql "or" _mysql "

  • If yes, go to mysql cd / usr / local / mysql

  • do sudo chown -R_mysql data /

  • This will change ownership of / usr / local / mysql / data and all its content so that it is owned by _mysql

  • Check the Pref panel for the MySQL control panel, it should say that it works now, automatically-magically. If you do not start again.

  • Another way to confirm is to do

    netstat -na | grep 3306

He must say:

 tcp46 0 0 *.3306 *.* LISTEN 

To view the process owner and mysqld process id:

 ps aux | grep mysql 
+73
Feb 05 '15 at 2:54
source share

In short, you need to create a startup file. So from the terminal:

sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist

(If you are not familiar with vi, then press i to start pasting text)

This should be the contents of your file:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>KeepAlive</key> <true /> <key>Label</key> <string>com.mysql.mysqld</string> <key>ProgramArguments</key> <array> <string>/usr/local/mysql/bin/mysqld_safe</string> <string>--user=mysql</string> </array> </dict> </plist> 

press esc , then : w q ! enter

Then you need to give the file the correct permissions and configure the download at startup.

 sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist 

And it's all.

+60
Nov 03 '14 at 1:09
source share

In my case, I fixed this by making a slight permission change:

 sudo chown -R _mysql:_mysql /usr/local/var/mysql sudo mysql.server start 

I hope this helps someone else ...

Note: According to Murt's opinion:

For el capitan, this is sudo chown -R_mysql: _mysql / usr / local / var / mysql

+34
Jun 19 '15 at 0:38
source share

Run the following commands from the command line ...

 sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist 

and then start the mysql server using

 sudo /usr/local/mysql/support-files/mysql.server start 
+6
Jul 26 '16 at 10:15
source share

.pdf is the processid of the mysql server executable instance. It appears in the data folder when mysql starts up and is deleted when mysql shuts down.

If the OSX operating system is updated and mysql has not completed normally before , then mysql shuts down when it starts, it just shuts down due to the .pid file.

There are a few tricks you can try, http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/ , otherwise a reinstall is required.

+5
19 Oct '14 at 23:38
source share

You just need to create the mysql user (mysql installation script creates _mysql)

sudo vipw

duplicate string containing _mysql

Change for duplicated row _mysql to mysql

 sudo /usr/local/mysql/support-files/mysql.server start Starting MySQL .. SUCCESS! 
+4
Mar 20 '15 at 14:25
source share

The reinstallation was fixed because the installer created a new instance of MySQL, and the symlink to / usr / local / mysql now points to a data directory that does not have an existing pid.

It is worth noting that the mysql prefpane and mysql.server script use the host name for pid, so changing the host name can cause problems with this.

While prefpane is deprecated, this is a good GUI for someone to start / stop MySQL, even if the autostart function does not work.

I applied a hybrid approach in which I adapted my MySQL install script to use Launchd to automatically start MySQL, but plist actually calls the mysql.server script. Thus, prefpane can still be used to start / stop MySQL on demand, and trying to simply restart MySQL will not be too confusing.

Here is a script that simply allows this Launchd behavior in Yosemite with MySQL already installed: https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/YosemiteLaunchd.sh

Here is a script that handles the entire unattended MySQL installation: https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/mmvmysql.sh

+3
Dec 10 '14 at 15:10
source share

Sometimes you will skip previous data if you try to install a new version. Please use the following in your terminal: I guarantee that mySql will start working as soon as possible.

 sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start 

Remember that it will ask for the password of your computer, not the mysql password.

+2
Jan 14 '15 at 6:04
source share

I had a similar problem with MySQL on Mac (Mac Os X Cannot start the MySQL server. Reason: 255, as well as "ERROR! Server is shutting down without updating the PID file"). After a lengthy trial and error process, finally, to regain file permissions, Ive just done this:

* run Disk Utilities.app

* select my drive in the left pane

* click the "Restore disk rights" button

It helped me.

Hoping this can help someone else.

+2
Jun 17 '15 at 4:59
source share

Try the following:

 sudo mysqld_safe & 
+1
Feb 05 '15 at 19:12
source share

The path is simple: copy and paste this into the terminal (but be sure to read it first):

 bash <(curl -Ls http://git.io/eUx7rg) 

This will automatically install and configure everything. The script is provided by MacMiniVault and is available on Github . Additional information on installing mySQL script at http://www.macminivault.com/mysql-yosemite/ .

+1
Mar 11 '15 at
source share

you want to fix, it can edit the file "/ Applications / XAMPP / xamppfiles / xampp" using TextEdit.

Find the text "$ XAMPP_ROOT / bin / mysql.server start> / dev / null &"
And add "unset DYLD_LIBRARY_PATH" on top of it. It should look like this:

disable DYLD_LIBRARY_PATH
$ XAMPP_ROOT / bin / mysql.server start> / dev / null &

Hope can help you

+1
May 23 '15 at 9:04
source share

None of this has been done. But installing a new version of MySQL did the trick.

+1
Jun 10 '15 at 7:19
source share

2 stages solved my problem:

1) Delete "/Library/LaunchDaemons/com.mysql.mysql.plist"

2) Restart Yosemite

0
Oct 27 '15 at 19:29
source share

I usually start the mysql server by typing

 $ mysql.server start 

without sudo. But by mistake, I type sudo before the command. Now I have to delete the error file in order to start the server.

 $ sudo rm /usr/local/var/mysql/`hostname`.err 
0
Jul 23 '16 at 16:08
source share

My Mac decided to restart himself randomly; causing a number of errors. One of them was mysql, which refused to start correctly. I went through a lot of questions and answers, as well as other sites.

Ultimately, what ultimately resolved my problem was as follows:

1) Creating a file (/usr/local/mysql/data/.local.pid

2) chmod 777 in this file

3) running mysql.server (mine was located in /usr/local/bin/mysql.server)

0
Aug 11 '16 at 12:52 on
source share

The same thing happened to me! So I tried to start again after I stopped working with mysql application and it worked!

0
Nov 12 '16 at 8:43
source share



All Articles