gpt4 book ai didi

docker - 如何修复mysql错误日志中的 "mbind: Operation not permitted"

转载 作者:行者123 更新时间:2023-12-02 07:20:36 26 4
gpt4 key购买 nike

我的 MySQL 错误日志有问题,目前主要由“mbind:不允许操作”行组成(见下文)。为什么会发生这种情况以及如何解决它?

这是“主要”部分让我困扰。如下所示,并非所有行都是“mbind:不允许操作”。我怀疑MySQL查询错误应该代替该行,但由于某种原因它们无法写入文件。

MySQL 本身是一个 Docker 容器,其中日志文件通过以下方式存储:

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

有趣的是:

  • “docker log 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 一直困扰着我并阻止我看到实际的错误。

最佳答案

将功能 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

引用文献:

关于docker - 如何修复mysql错误日志中的 "mbind: Operation not permitted",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55559386/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com