首页 > 解决方案 > MySql docker 容器权限问题

问题描述

在我们的 IT 部门增加了服务器的 RAM 内存后,MySql docker 容器突然停止工作。最初的错误是:

2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05 07:49:44+00:00 [Note] [Entrypoint]: Initializing database files
2021-10-05T07:49:44.695485Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.25) initializing of server in progress as process 44
2021-10-05T07:49:44.700805Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-10-05T07:49:44.709596Z 1 [ERROR] [MY-012576] [InnoDB] Unable to create temporary file; errno: 13
2021-10-05T07:49:44.709749Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2021-10-05T07:49:44.710086Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-10-05T07:49:44.710162Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2021-10-05T07:49:44.710272Z 0 [ERROR] [MY-010119] [Server] Aborting

所以我使用 docker-composevolumes标签将 docker /tmp 目录映射到主机的 /tmp 目录,这解决了这个问题,但现在我有另一个我无法解决的问题,我真的找不到任何关于这个问题的工作. 我怀疑 IT 人员更改了系统中导致此问题的某些内容,但我找不到是什么。

2021-10-05 12:32:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05 12:32:08+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-10-05 12:32:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-10-05T12:32:08.648765Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25) starting as process 1
2021-10-05T12:32:08.656676Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-10-05T12:32:08.829920Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-10-05T12:32:08.920421Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
2021-10-05T12:32:08.921019Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2021-10-05T12:32:09.027024Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-10-05T12:32:09.027478Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-10-05T12:32:09.030560Z 0 [ERROR] [MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2021-10-05T12:32:09.030972Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2021-10-05T12:32:09.031807Z 0 [ERROR] [MY-010119] [Server] Aborting

任何形式的帮助都会受到重视。

标签: mysqldocker

解决方案


推荐阅读