Docker部署MySQL8.0.39报错解决方案

Docker部署MySQL8.0.39报错解决方案

bash 复制代码
2024-09-11T06:09:09.317582Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 1024 (requested 8161)
2024-09-11T06:09:09.317586Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 431 (requested 4000)
2024-09-11T06:09:09.318503Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-09-11T06:09:09.318586Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.39) initializing of server in progress as process 80
2024-09-11T06:09:09.319592Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2024-09-11T06:09:09.319596Z 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.
2024-09-11T06:09:09.319629Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-09-11T06:09:09.319697Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.39)  MySQL Community Server - GPL.

通过Docker部署MySQL8.0.3x报错,这边部署的是8.0.39,之前用的8.0.2x一点毛病都没,报错信息上面那些,大概原因是因为权限导致/var/lib/mysql目录没法初始化之类的

解决

启动docker的时候增加 privileged: true 和user: root

相关推荐
人机(未转人工)21 分钟前
Flask + MySQL + Ollama(DeepSeek) 漏洞资产库 的网络安全资产分析平台的templates中(chat.html)渲染文件
mysql·flask·html
词却22 分钟前
数据库基础:MySQL 安装与基础操作
数据库·mysql
xieliyu.27 分钟前
MySQL 进阶笔记:用户 / 会话 / 全局 / 局部变量 + CASE 分支语法
开发语言·数据库·笔记·mysql
川石课堂软件测试1 小时前
自动化测试常见的异常处理
python·jmeter·mysql·docker·容器·单元测试·grafana
骇客野人1 小时前
MySQL / PostgreSQL 单表及表数据备份恢复实施方案
数据库·mysql·postgresql
动力 continue1 小时前
MySQL 与网络基础 · 外键约束及 TCP/UDP 协议
网络·tcp/ip·mysql
不过普通话一乙不改名2 小时前
补充:权限与角色
mysql
蒲锘2 小时前
DevOps 实验阶段四:Infra 节点 + MySQL + Spring Boot 容器化
spring boot·mysql·docker
呆呆小孩13 小时前
零基础学 MySQL(上):从建库建表到增删改查,一篇搭好 SQL 基础
android·sql·mysql
我不会插花弄玉15 小时前
2.库的操作【由浅入深-MySQL】
数据库·mysql