mysql errno 1_mysql从库 Last_SQL_Errno: 1 的错误的解决过程

Last_SQL_Errno: 1

Last_SQL_Error: Unable to use slave's temporary directory /tmp - Can't create/write to file '/tmp/SQL_LOAD-955cf212-bd60-11e7-8698-d0946601b0e9' (Errcode: 13 - Permission denied)

从库缓存 /tmp 下无法写入权限

\q 退出mysql

ll -d  /tmp/

drwxrwxrwt. 2 root root 40 11月  1 03:49 /tmp/

普通用户上执行权限是t,而不是x

尝试处理方法 chmod o-t  /tmp

drwxrwxrwx. 2 root root 40 11月  1 03:49 /tmp/  (感觉这样有一定的安全隐患)

重启mysql服务 失败  ,查看提示错误日志 journalctl -xe

SELinux is preventing /usr/bin/python2.7 from read access on the directory /tmp. For complete SELinux mess

故关掉 selinux:setenforce = 0

( 可以单独设置mysql写入权限的bool值

查看:getsebool -a | grep mysql

设置:setsebool -P  mysql_connect_any on

设置:setsebool -P selinuxuser_mysql_connect_enabled on)

重启mysql服务  成功

重新登录mysql 发现已经成功同步了,但又感觉这个错误不是 t 权限导致的,为了降低/tmp的安全隐患

故退出mysql 重新重新 chmod o+t  /tmp

再重启mysql服务 登录mysql

同步暂时无报错,后待观察

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值