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

vltsax25  于 2023-01-20  发布在  Nginx
关注(0)|答案(2)|浏览(263)

我有一个问题,我的MySQL错误日志,目前主要包括“mbind:操作不允许”行(见下文)。为什么会发生这种情况,我如何修复它?
困扰我的是“大多数”部分,正如你在下面看到的,并不是所有的行都是“mbind”:操作不允许”。我怀疑MySQL查询错误应该代替该行,但由于某种原因,它们无法写入文件。
MySQL本身是一个Docker容器,其中日志文件通过以下方式进行卷化:

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

有趣的是:

  • “docker日志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]

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

mwg9r5ms

mwg9r5ms1#

CAP_SYS_NICE功能添加到您的容器中,直到MySQL服务器可以"静默"地自行处理错误。

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

如果没有docker-compose,则可以通过以下方式定义CAP_SYS_NICE

docker run --cap-add=sys_nice -d mysql

参考文献:

doinxwow

doinxwow2#

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

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

相关问题