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

相关推荐
杨凯凡1 小时前
MySQL入门指南:环境搭建与服务管理全流程
数据库·mysql
forestsea2 小时前
MySQL 入门大全:数据类型
数据库·mysql
Dreams°1232 小时前
【Python爬虫 !!!!!!政府招投标数据爬虫项目--医疗实例项目文档(提供源码!!!)!!!学会Python爬虫轻松赚外快】
分布式·爬虫·python·mysql·scikit-learn
gb42152873 小时前
mysql数据库中某个数据表的碎片率自己降低了,mysql数据表对碎片率有自动优化机制吗?
数据库·mysql
有时间要学习3 小时前
MySQL——数据类型&&表的约束
数据库·mysql
珹洺4 小时前
Jsp技术入门指南【十四】实现基于MySQL+JDBC+JSP数据库验证的登录界面与登录跳转功能
java·运维·数据库·mysql·servlet
JhonKI4 小时前
【MySQL】日志缓冲区详解 以及 InnoDB内存结构总结
数据库·mysql·oracle
vvilkim5 小时前
MySQL视图:虚拟表的强大功能与应用实践
数据库·mysql
斌果^O^6 小时前
mysql常用方法
数据库·mysql
全职计算机毕业设计6 小时前
SpringBoot Vue MySQL酒店民宿预订系统源码(支付宝沙箱支付)+代码讲解视频
vue.js·spring boot·mysql