我也遇到相同的问题了

`

docker run \-p 4406:3306 \

-e MYSQL_ROOT_PASSWORD=localDocker@mysql \

-e TZ=Asia/Shanghai \

-v /mnt/hgfs/docker/mysql/data:/var/lib/mysql \

-v /mnt/hgfs/docker/mysql/log:/var/log/mysql:rw \

-v /mnt/hgfs/docker/mysql/mysql-files:/var/lib/mysql-files/ \

--name mysql \

--restart=always \

--privileged=true \

-d mysql

`

容器日志

`

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Initializing database files,

mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied),

2020-11-16T13:02:35.467186Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 42,

2020-11-16T13:02:35.468548Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.,

2020-11-16T13:02:35.468556Z 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.,

2020-11-16T13:02:35.468587Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:35.468687Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:35+08:00 [Note] [Entrypoint]: Initializing database files,

mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied),

2020-11-16T13:02:35.924495Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 41,

2020-11-16T13:02:35.925856Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.,

2020-11-16T13:02:35.925863Z 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.,

2020-11-16T13:02:35.925936Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:35.926033Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:36+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:36+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:36+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:36+08:00 [Note] [Entrypoint]: Initializing database files,

mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied),

2020-11-16T13:02:36.505154Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 41,

2020-11-16T13:02:36.506503Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.,

2020-11-16T13:02:36.506510Z 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.,

2020-11-16T13:02:36.506540Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:36.506632Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:37+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:37+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:37+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:37+08:00 [Note] [Entrypoint]: Initializing database files,

2020-11-16T13:02:37.262651Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 41,

2020-11-16T13:02:37.268134Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive,

2020-11-16T13:02:37.271110Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.,

2020-11-16T13:02:40.732042Z 1 [ERROR] [MY-012128] [InnoDB] posix_fallocate(): Failed to preallocate data for file ./#innodb_temp/temp_1.ibt, desired size 81920 Operating system error number 5. Check that the disk is not full or a disk quota exceeded. Make sure the file system supports this function. Refer to your operating system documentation for operating system error code information.,

2020-11-16T13:02:40.733857Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB Database creation was aborted with error Out of disk space. You may need to delete the ibdata1 file before trying to start up again.,

2020-11-16T13:02:40.984199Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.,

2020-11-16T13:02:40.984464Z 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.,

2020-11-16T13:02:40.984787Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:40.985070Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:42+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:42+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:42+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:42+08:00 [Note] [Entrypoint]: Initializing database files,

2020-11-16T13:02:42.226354Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 42,

2020-11-16T13:02:42.227867Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.,

2020-11-16T13:02:42.227875Z 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.,

2020-11-16T13:02:42.227910Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:42.228011Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:44+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:44+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:44+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:44+08:00 [Note] [Entrypoint]: Initializing database files,

2020-11-16T13:02:44.180185Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 42,

2020-11-16T13:02:44.181779Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.,

2020-11-16T13:02:44.181787Z 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.,

2020-11-16T13:02:44.181824Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:44.181941Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:47+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:47+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:47+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:47+08:00 [Note] [Entrypoint]: Initializing database files,

2020-11-16T13:02:47.765966Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 42,

2020-11-16T13:02:47.767474Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.,

2020-11-16T13:02:47.767482Z 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.,

2020-11-16T13:02:47.767517Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:47.767612Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:02:54+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:54+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:02:54+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:02:54+08:00 [Note] [Entrypoint]: Initializing database files,

2020-11-16T13:02:54.562853Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 42,

2020-11-16T13:02:54.564390Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.,

2020-11-16T13:02:54.564398Z 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.,

2020-11-16T13:02:54.564434Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:02:54.564528Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

2020-11-16 21:03:07+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:03:07+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql',

2020-11-16 21:03:07+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.,

2020-11-16 21:03:07+08:00 [Note] [Entrypoint]: Initializing database files,

2020-11-16T13:03:07.739568Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 42,

2020-11-16T13:03:07.741069Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.,

2020-11-16T13:03:07.741077Z 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.,

2020-11-16T13:03:07.741110Z 0 [ERROR] [MY-010119] [Server] Aborting,

2020-11-16T13:03:07.741203Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.,

`

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐