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

相关推荐
承渊政道10 分钟前
【MySQL数据库学习】(MySQL表的内外连接)
数据库·学习·mysql·leetcode·bash·数据库开发·数据库系统
摇滚侠10 小时前
mariadb-libs 被 mysql-community-libs-5.7.28-1.el7.x86_64 取代
数据库·mysql·mariadb
DIY源码阁10 小时前
JavaSwing饮品管理系统 - MySQL版
java·数据库·mysql·eclipse
yoothey13 小时前
MySQL事务机制解析 - 面试高分知识点
数据库·mysql·面试
峥无13 小时前
MySQL DML 操作(CRUD)总结
数据库·mysql
基德爆肝c语言16 小时前
MySQL表的操作
前端·数据库·mysql
GreatSQL16 小时前
gt-checksum v4.0.0 新功能解读系列文章(1):断点续传——大任务中断不再从头跑
mysql
南部余额21 小时前
Canal解决MySQL与Redis数据一致性问题
数据库·redis·mysql·canal·数据·数据同步
斯内普吖1 天前
(开源)高校素拓分管理系统小程序实战指南 基于 Java + SpringBoot + uni-app + Vue + MySQL
java·spring boot·mysql·小程序·uni-app·开源
lazy H1 天前
Spring Boot 连接 MySQL 失败怎么办?常见报错原因和解决方法总结
spring boot·后端·学习·mysql·spring