After MySQL install via Brew, I get the error - Th

2019-01-12 16:55发布

Ok, I've searched all over and have spent quite a bit of my time installing, uninstalling, trying various option but without success.

I'm on Mac OS X Lion (10.7.3) and am trying to setup a Python, MySQL.

I successfully installed Python and MySQL via HomeBrew. Python works great.

After MySQL Installation, I followed the first 2 steps - unset and the mysql_install_db commands.

Now, when I try to start mysql "mysql.server start", I get the following error

ERROR! The server quit without updating PID file (/usr/local/var/mysql/Brajeshwar.local.pid).
  • Brajeshwar is my username on my machine.

25条回答
乱世女痞
2楼-- · 2019-01-12 17:37

This worked for me:

sudo chmod -R 777 /usr/local/var/mysql/
sudo /usr/local/mysql/support-files/mysql.server start
查看更多
霸刀☆藐视天下
3楼-- · 2019-01-12 17:38

I had the similar issue. But the following commands saved me.

cd /usr/local/Cellar
sudo chown _mysql mysql
查看更多
Emotional °昔
4楼-- · 2019-01-12 17:40

For me it worked with:

unset TMPDIR
mysql_install_db --user=`whoami` --basedir="$(brew --prefix mariadb)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
查看更多
Root(大扎)
5楼-- · 2019-01-12 17:40

My solution on OSX El Capitan was:

sudo chmod ugo+w /tmp

It was broken suddenly.

The error was:

ERROR! The server quit without updating PID file

and the log showed:

Can't start server : Bind on unix socket: Permission denied

It might also be helpful to note, that under OSX there is no my.cnf file by default and not needed by default, which I did not know. Good luck!

查看更多
ら.Afraid
6楼-- · 2019-01-12 17:42

What worked for me was:

  1. Go to your mysql installation directory
  2. sudo chmod -R 777 data
  3. Then go back one directory
  4. cd support-files/
  5. sudo ./mysql.server start

After that the server started running.

But the problem with this method is that I have to repeat this every time I want to start the mysql now. Don't know why it started behaving like this suddenly.

查看更多
Ridiculous、
7楼-- · 2019-01-12 17:44

If I remember correctly it is a permissions issue. Try to 'touch' and 'chmod' the pid file or the folder the file is held in.

查看更多
登录 后发表回答