如何修复mysql错误日志中的“ mbind:不允许操作”

时间:2019-04-07 13:13:02

标签: docker nginx ubuntu-18.04 mysql-8.0

我的MySQL错误日志存在一个问题,该日志目前主要由“ mbind:不允许操作”行组成(请参见下文)。为什么会发生,如何解决?

这是困扰我的“大部分”部分。如下所示,并非所有行都是“ mbind:禁止操作”。我怀疑MySQL查询错误应该代替该行,但由于某些原因,它们无法写入文件中。

MySQL本身是一个Docker容器,其中的日志文件可通过以下方式卷入:

volumes:
- ./mysql/log:/var/log/mysql

有趣的是:

  • “码头工人日志mysql_container”什么也没显示...
  • 驻留在同一卷文件夹中的
  • slow.log完全可以,并且其中包含真正的慢日志行,没有任何“ mbind:不允许操作”!
  • 与slow.log一样,进入general.log,在这里也没问题

有什么想法吗?预先谢谢你。

2019-04-07T12:56:22.478504Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-04-07T12:56:22.478533Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2019-04-07T12:56:22.478605Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 1
2019-04-07T12:56:22.480115Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2019-04-07T12:56:22.480122Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
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
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
[same line goes forever]

P.S。 MySQL启动并运行良好,没有问题。正是这个error.log一直困扰着我,并阻止我看到实际的错误。

2 个答案:

答案 0 :(得分:0)

在docker-compose.yml中添加security_opt选项有助于解决此问题:

database:
  image: mysql:latest
  container_name: mysql_0
  ports:
    - "3306:3306"
  security_opt:
    - seccomp:unconfined

答案 1 :(得分:0)

向您的容器中添加功能CAP_SYS_NICE,直到MySQL服务器可以“静默”地处理错误为止。

service:
  mysql:
    image: mysql:8.0.15
    ...
    cap_add:
      - SYS_NICE  # CAP_SYS_NICE

参考文献: