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

相关推荐
luoluoal26 分钟前
基于python的语音和背景音乐分离算法及系统(源码+文档)
python·mysql·django·毕业设计·源码
·云扬·42 分钟前
MySQL单机多实例部署两种实用方法详解
数据库·mysql·adb
洛小豆1 小时前
她问我:数据库还在存 Timestamp?我说:大人,时代变了
数据库·后端·mysql
洛小豆1 小时前
代码修仙录 · 第1期:宗门大阵崩了?只因少了毫秒三魂!
数据库·后端·mysql
墨瑾轩2 小时前
MySQL索引创建不锁表:90%的DBA都踩过的3个坑!
mysql·adb·dba
逻极2 小时前
数据分析项目:Pandas + SQLAlchemy,从数据库到DataFrame的丝滑实战
python·mysql·数据分析·pandas·sqlalchemy
luoluoal2 小时前
基于python的英汉电子词典软件(源码+文档)
python·mysql·django·毕业设计·源码
UCH1HA3 小时前
MySQL主从复制与读写分离
linux·mysql·集群
自燃人~3 小时前
为什么MySQL用b+不用B数
数据库·mysql
warton884 小时前
ubuntu24.04 安装mysql8.0.36
linux·运维·mysql