PID error on mysql.server start?

2019-01-08 12:26发布

I've just tried installing MySQL using homebrew (on Mac OS X 10.6), but I've run across an issue at the first hurdle. When trying to manually start the server (mysql.server start), I get the following error:

. ERROR! Manager of pid-file quit without updating file.

Unfortunately I'm not sure of which error logs or configuration files to check, as I've never installed MySQL in this way before.

7条回答
欢心
2楼-- · 2019-01-08 12:57

Nothing else really helped, but the following worked:

$ ps aux | grep mysql
tagir           27260   0.0  1.0  3562356 175120   ??  S     2:52PM   0:00.42 mysqld --skip-grant-tables
tagir           42704   0.0  0.0  2434840    784 s000  S+    3:04PM   0:00.00 grep mysql
$ kill 27260
# Careful! This might erase your existing data
$ rm -rf /usr/local/var/mysql
$ mysqld --initialize
$ mysql.server start
查看更多
够拽才男人
3楼-- · 2019-01-08 13:02

These following two commands should solve your issue.

> unset TMPDIR
> mysql_install_db --verbose --user=\`whoami\` --basedir="$(brew
--prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
查看更多
Melony?
4楼-- · 2019-01-08 13:03

you probably need to ensure that you're running mysql as the root user -- otherwise it won't have permission to write the PID file (thus the error you're receiving).

Try this:

sudo mysql.server start

you'll be prompted for your password. (this assumes that your user account has permissions to "sudo" -- which it should, unless it's setup as a restricted user account in OS X).

This may not be the only issue -- but it should get you to the next step anyway.

good luck!

查看更多
劫难
5楼-- · 2019-01-08 13:04

It appears that for whatever reason I can't comment below Immendes above, but on 10.8.2 with mySQL 5.6.10, in addition to verifying the db_install and adding the my.cnf, I also had to chown -R myusername /tmp/mysql.sock.

It appears that allowing mySQL to run under the user (as apposed to root or www as I woudl do on linux) is not the best idea in this regard (though Homebrew could update the formula -- beyond my scope and time).

查看更多
一夜七次
6楼-- · 2019-01-08 13:09

I ran into the same issue while trying to install MySQL 5.5.15 in Lion using homebrew and resolved the issue with:

mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

and creating a the file ~/my.cnf

with the content:

 [mysqld]
   basedir=/usr/local/Cellar/mysql/5.5.15
   datadir=/usr/local/var/mysql

basedir - should be your current MySQL instalation dir datadir - should be the location of MySQL data

You can figure out that too location by watching the make command during the "brew install mysql" searching for something like this:

-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.15 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/mysql

Where DCMAKE_INSTALL_PREFIX = basedir and DMYSQL_DATADIR = datadir

查看更多
Melony?
7楼-- · 2019-01-08 13:20

I ran into this same problem when installing via homebrew. Make sure you run these commands (which are listed during install but easy to miss):

unset TMPDIR
mysql_install_db
查看更多
登录 后发表回答