Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew install mysql, error when trying to stop the server

After:

brew install mysql
mysql_install_db

and I try to stop the MySQL server:

$ mysql.server stop
Shutting down MySQL
.. ERROR! Manager of pid-file quit without updating file.

How can I fix the above error? Thanks!

Info:

$ mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.51 Source distribution
like image 814
ohho Avatar asked Nov 01 '10 04:11

ohho


People also ask

Is there a MySQL installer for Mac?

MySQL for macOS is available in a number of different forms: Native Package Installer, which uses the native macOS installer (DMG) to walk you through the installation of MySQL.

Where is MySQL installed on Mac?

By default, the MySQL directories are installed under /usr/local/ . Even better, add /usr/local/mysql/bin to your PATH environment variable. You can do this by modifying the appropriate startup file for your shell. For more information, see Invoking MySQL Programs.

How do I know if MySQL is installed on my Mac?

Try typing "echo $PATH" on your terminal to see if /usr/local/mysql/bin is on the path. Additionally, on the terminal, you can type "which mysql". If that returns nothing your environment is not seeing your MySQL installation.


2 Answers

The install instructions for mysql suggest copying /usr/local/Cellar/mysql/5.1.54/com.mysql.mysqld.plist to ~/Library/LaunchAgents so that Mac OS X will automatically launch mysqld when you login.

If you've set up mysqld this way then the launchd process, which controls LaunchAgents in Mac OS X v10.4 and above, will automatically restart the mysqld process as soon as it is being killed by the mysql.server stop command. This might be the reason for the error message, because the server is being automatically restarted.

Just tested this on my Mac. Ran the mysql.server stop command ten times and each time 'launchd' restarted the msyqld process after about a second. Six times the command ended with a "SUCCESS!" message. Four times it ended with the "ERROR! Manager of pid-file quit without updating file" message.

UPDATE: Just realised I didn't mention how to stop the mysqld server if it is being started by launchd.

Here is the command to stop the mysqld daemon.

launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist

like image 105
Alistair McMillan Avatar answered Sep 19 '22 13:09

Alistair McMillan


Have you tried running killall mysqld?

like image 31
nikola Avatar answered Sep 20 '22 13:09

nikola