OS X, Homebrew, MySQL problem

657 views
Skip to first unread message

Scott Olmsted

unread,
Jul 29, 2011, 3:08:48 PM7/29/11
to SD Ruby
I got a Mac mini last summer and installed Homebrew, Rails, MySQL
5.1.49, and a few other tools. I then got really busy and never got
back to it (I'm reasonably productive on Ubuntu).

Now I want to get back to the Mac. I updated OS X, which I think was
what brought that to 10.6.8.

But trying

mysql -u root -p

gives

ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2)

mysql is not running (nothing from 'ps aux'), but I am unable to start
it:

$ mysql.server start
Starting MySQL
. ERROR! Manager of pid-file quit without updating file.

and nothing I can find online helps, though I get hints that the
upgrade to 10.6.8 may be at fault. I can't find a my.cnf file
anywhere.

Perhaps I need to reinstall MySQL 5.1 with homebrew, though I'm not
sure how to do that.

Thanks for any help you can give me.

Scott

James Miller

unread,
Jul 29, 2011, 3:14:02 PM7/29/11
to sdr...@googlegroups.com
Try doing a `brew update` and `brew install mysql` -- it should supply instructions for getting MySQL running after the install completes.

James

Scott Olmsted

unread,
Jul 29, 2011, 3:17:43 PM7/29/11
to SD Ruby
$ brew install mysql
Formula already installed: /usr/local/Cellar/mysql/5.1.49

Glenn Little

unread,
Jul 29, 2011, 3:24:05 PM7/29/11
to sdr...@googlegroups.com
If mysql is not running, you can just remove the pid file. If you can
find it. Here (centos linux), it's in /var/run/mysqld/mysql.pid If
it's not there, check your mysqld startup file for a clue
(/etc/init.d/mysqld, again, here... not sure where it might be on your
OS). Or try a "locate mysqld.pid".

Delete the file, and try restarting your mysql service.

-glenn

On Fri, Jul 29, 2011 at 12:08 PM, Scott Olmsted <solm...@gmail.com> wrote:

Scott Olmsted

unread,
Jul 29, 2011, 3:43:31 PM7/29/11
to SD Ruby
$ locate mysql.pid

WARNING: The locate database (/var/db/locate.database) does not exist.
..... [not going to create that database now]

so let's try

$ find / -name mysql.pid

produces nothing, and

$ find / -name init.d

also produces nothing.

How do I uninstall and reinstall mysql in Homebrew?

Dennis Ryan

unread,
Jul 29, 2011, 3:45:02 PM7/29/11
to sdr...@googlegroups.com
try:
brew remove mysql
brew upgrade
brew install mysql

should install mysql >= 5.1.56 which i have currently

Glenn Little

unread,
Jul 29, 2011, 4:08:39 PM7/29/11
to sdr...@googlegroups.com
Sorry, I typoed, that should have been mysqld.pid. Does OS X have a
/var/run/mysqld/mysqld.pid?

About init.d, I guess that's not an OS X thing. There are startup
scripts somewhere, and the path to the pid file may be in the one for
mysqld, but I have no idea where that sort of thing is on OS X, sorry.

-glenn

Scott Olmsted

unread,
Jul 29, 2011, 5:12:51 PM7/29/11
to SD Ruby
That worked, especially after I followed Homebrew's instructions
carefully.

But I got version 5.1.49 again, I wonder why.

Thanks very much, everyone!

Scott


On Jul 29, 12:45 pm, Dennis Ryan <dsr...@gmail.com> wrote:
> try:
> brew remove mysql
> brew upgrade
> brew install mysql
>
> should install mysql >= 5.1.56 which i have currently
>
>

Dennis Ryan

unread,
Jul 29, 2011, 5:47:15 PM7/29/11
to sdr...@googlegroups.com
you might want to run:
brew outdated
and see what it says, seems like your formula is out of date.

-Dennis
Reply all
Reply to author
Forward
0 new messages