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

相关推荐
一码归一码@12 小时前
Mysql进阶之事务原理
数据库·mysql
东城绝神20 小时前
《Linux运维总结:基于ARM64+X86_64架构使用docker-compose一键离线部署MySQL8.0.43 NDB Cluster容器版集群》
linux·运维·mysql·架构·高可用·ndb cluster
衫水1 天前
[特殊字符] MySQL 常用指令大全
数据库·mysql·oracle
阿杰 AJie1 天前
MySQL 里给表添加索引
数据库·mysql
林鸿群1 天前
ubuntu 26.04 安装mysql-server
linux·mysql·ubuntu
_F_y1 天前
MySQL表的操作
android·数据库·mysql
千寻技术帮1 天前
10336_基于SSM的少数民族文化商城
mysql·毕业设计·ssm·非遗商城
fenglllle1 天前
MySQL explain format的差异
数据库·mysql
liux35281 天前
MySQL主从复制技术全面解析:从基础原理到高级架构实践(八)
mysql
a程序小傲1 天前
听说前端又死了?
开发语言·前端·mysql·算法·postgresql·深度优先