问题描述
我在Macbook Pro中安装mysql后,执行命令时:
After I install the mysql in my Macbook Pro, when I excute the order:
$ sudo ln -s /usr/local/mysql/bin/mysql /usr/bin
我得到一个错误:
我尝试了以下方法:
I have tried the method below:
方法1:
1)vim ~/.bash_profile
2)添加export PATH=$PATH:/usr/local/mysql/bin
1) vim ~/.bash_profile
2) add export PATH=$PATH:/usr/local/mysql/bin
3)source ~/.bash_profile
推荐答案
由于Apple的系统完整性保护,您收到此错误消息.系统完整性保护包括对系统以下部分的保护:
You get this error message because of Apple's System Integrity Protection. System Integrity Protection includes protection for these parts of the system:
/System
/usr
/bin
/sbin
Apps that are pre-installed with OS X
第三方应用程序和安装程序可以继续编写的路径和应用程序包括:
Paths and apps that third-party apps and installers can continue to write to include:
/Applications
/Library
/usr/local
这意味着您可以简单地在/usr/local/bin
中创建符号链接(它仍在您的$PATH
中),但不能在/usr/bin
中创建.
This means that you can simply create a symbolic link in /usr/local/bin
(it's still in your $PATH
), but not in /usr/bin
.
此外,您可以通过以下方式禁用系统完整性保护(我强烈建议您这样做):
Also, you can disable System Integrity Protection (I strictly advise against that) by:
- 点击菜单.
- 选择重新启动...
- 按住Command-R引导进入恢复系统.
- 单击实用工具"菜单,然后选择终端".
- 键入csrutil disable,然后按回车键.
- 关闭终端应用程序.
- 单击菜单,然后选择重新启动....
这篇关于ln:/usr/bin/mysql:不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!