0x01 故障
因为之前本来准备用macbook来替代pro的工作,但是后来发现不用替代,因为本身这两者没冲突,家里有两个显示器,所以正好用pro来做些事情。刚好,跟媳妇说了下准备多买一个转接口,媳妇也同意了。然后就准备在本地再装个环境。然后问题就来了~
0x02 Error status
在用brew 安装mysql的时候,就发现出现故障,一直提示什么权限不对,我就纳闷了,一开始还好好的,装的都没事,咋就安装mysql就不行了。真心跪了~
Error: Cowardly refusing to 'sudo brew install'
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
这个提示告诉我,brew的权限有问题,我挺纳闷的。我试着执行nmap的安装,屁事没有。。。
➜ sosrp git:(vuls) brew install nmap
Warning: nmap-7.01 already installed
好吧,这是一个悲剧。。。
0x03 解决问题
说了权限问题,我就去找。。然后找到目标的位置,改了下,果然就行了。在这记录下,避免下次遇到。
➜ sosrp git:(vuls) sudo chown root:wheel /usr/local/bin/brew
➜ sosrp git:(vuls) sudo brew install mysql
==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.11.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mysql-5.7.11.el_capitan.bottle.tar.gz
==> /usr/local/Cellar/mysql/5.7.11/bin/mysqld --initialize-insecure --user=root --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/usr/local/var/mysql --t
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
To connect run:
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
==> Summary
🍺 /usr/local/Cellar/mysql/5.7.11: 12,812 files, 434.6M