redhat安装mysql主从We trust you have received the usual lecture from the local System问题处理

错误提示:

We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.

#2) Think before you type.

#3) With great power comes great responsibility.

错误日志

根本原因是mysql用户去执行脚本中的sudo命令时权限不够,所以我们需要为其配置sudo权限并加上免密配置。

① 使用su命令切换超级用户(root用户)

② 我们需要在sudoers配置文件中修改,所以先为该文件配置写权限:

chmod u+w /etc/sudoers        // 给/etc下的sudoers文件加上write权限

③ 进入sudoers文件,加上对应用户的配置语句:

vi /etc/sudoers        //进入文件后找到## Allows people in group wheel to run all commands

找到该句

④ 配置用户sudo免密权限。按i进入insert模式,在root ALL=(ALL) ALL下方加上:

[你需要配置的用户名] ALL = (ALL) ALL        //在sudo的时候需要输入密码

或 

[你需要配置的用户名] ALL = (ALL) NOPASSWD:ALL        //在sudo的时候不需输入密码

然后esc退出insert模式,按冒号后输入wq保存退出。

配置好后如图

⑤ 为了安全考虑移除sudoers文件的写权限:

chmod u-w /etc/sudoers        //移除sudoers的写权限

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容