mysql:mbind: Operation not permitted

在重启Docker容器内的MySQL服务时遇到'Operation not permitted'的问题,这通常是由于容器的安全策略限制所致。日志显示多条mbind错误。为了解决这个问题,可以在docker-compose.yml配置文件中添加'security_opt',设置为'unconfined'来禁用安全策略。这样可以解除权限限制,允许MySQL正常启动。配置更新后,重启容器即可解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mbind: Operation not permitted

重启docker容器中的mysql时,会出现operation not permitted问题
查看docker容器中mysql倒数100行日志发现:

//docker logs --tail="100" mysql-server-5.2.6
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted

原因是docker容器中有一个安全认证的环节。进入到docker-compose.yml配置文件中添加以下参数:

// 解决docker容器中的mysql安全认证问题
      security_opt:
        - seccomp:unconfined

看成品配置:

version: '5.2.6'
  services:
    mysql:
      image: mysql
      container_name: mysql
      # docker安全验证
      security_opt:
        - seccomp:unconfined
      ports:
        - 3306:3306

重启之后解决成功!

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值