How to fix “mbind: Operation not permitted” in mysql error log

邮差的信 提交于 2020-12-24 06:39:26

问题


I have a problem with my MySQL error log which currently mostly consists of "mbind: Operation not permitted" lines (see below). Why does it happen and how do I fix it?

It's the "mostly" part that bothers me. As you can see below, not all lines are "mbind: Operation not permitted". I suspect that MySQL query errors should be instead of that line, but for some reason they can't be written into the file.

MySQL itself is a Docker container where log files are volumed via:

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

What's interesting is that:

  • "docker logs mysql_container" shows nothing...
  • slow.log, which resides in the same volume folder, is completely OK and has real slow log lines in it, no "mbind: Operation not permitted" whatsoever!
  • same as slow.log goes to general.log — no problem here, either

Any ideas? Thank you in advance.

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 starts and runs well, no problem with that. It's just this error.log that keeps bothering me and prevents me from seeing actual errors.


回答1:


Add the capability CAP_SYS_NICE to your container until MySQL server can handle the error itself "silently".

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

References:

  • Docker Seccomp security profiles: https://docs.docker.com/engine/security/seccomp/
  • Docker resource constraints: https://docs.docker.com/config/containers/resource_constraints/



回答2:


Adding the security_opt option in docker-compose.yml helped to solve this problem:

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


来源:https://stackoverflow.com/questions/55559386/how-to-fix-mbind-operation-not-permitted-in-mysql-error-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!