ln:/usr/bin/mysql:不允许操作 [英] ln: /usr/bin/mysql: Operation not permitted

查看:435
本文介绍了ln:/usr/bin/mysql:不允许操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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

我得到一个错误:

密码:
ln:/usr/bin/mysql:不允许操作

Password:
ln: /usr/bin/mysql: Operation not permitted


我尝试了以下方法:


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:

  1. 点击菜单.
  2. 选择重新启动...
  3. 按住Command-R引导进入恢复系统.
  4. 单击实用工具"菜单,然后选择终端".
  5. 键入csrutil disable,然后按回车键.
  6. 关闭终端应用程序.
  7. 单击菜单,然后选择重新启动....

这篇关于ln:/usr/bin/mysql:不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆