如问题标题中所述,我无法使用Homebrew安装mysql。
shubhamgoyal $ brew install mysql
`==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mysql-5.6.21.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/mysql-5.6.21.mavericks.bottle.tar.gz
==> Pouring mysql-5.6.21.mavericks.bottle.tar.gz
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built server starting up correctly.
To connect:
mysql -uroot
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> /usr/local/Cellar/mysql/5.6.21/bin/mysql_install_db --verbose --user=shubhamgoyal --basedir=/usr/local/Cellar/mysql/5.6.21 --datadir=/usr/local/var/mysql --tmpdir=/tmp
2014-10-02 14:29:01 18521 [Note] InnoDB: FTS optimize thread exiting.
2014-10-02 14:29:01 18521 [Note] InnoDB: Starting shutdown...
2014-10-02 14:29:03 18521 [Note] InnoDB: Shutdown completed; log sequence number 123515594
2014-10-02 14:29:03 18521 [Note] /usr/local/Cellar/mysql/5.6.21/bin/mysqld: Shutdown complete
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql`
==> Summary
/usr/local/Cellar/mysql/5.6.21: 9621 files, 339M
shubhamgoyal $ mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/27-43.priv23.nus.edu.sg.pid).`
我找不到任何/etc/my.cnf文件,所以我不知道为什么会出现这个问题。
答案 0 :(得分:2)
sudo chown -R $(whoami)/ usr / local
答案 1 :(得分:0)
如果您使用的是高山脉(High Sierra)或更高版本,则无法再/usr/local
处理。假设您使用Homebrew安装了mysql,请尝试:
sudo chown -R $(whoami) $(brew --prefix)/*