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

相关推荐
口嗨农民工34 分钟前
3.2 mysql客户端和服务器的启动与停止
数据库·mysql
t***31652 小时前
Docker 之mysql从头开始——Docker下mysql安装、启动、配置、进入容器执行(查询)sql
sql·mysql·docker
小马爱打代码2 小时前
避坑指南:MySQL 迁移到 TiDB
数据库·mysql·tidb
q***57743 小时前
MySQL 实验1:Windows 环境下 MySQL5.5 安装与配置
windows·mysql·adb
8***84824 小时前
如何在Linux中找到MySQL的安装目录
linux·运维·mysql
W***83204 小时前
如何在 Ubuntu 22.04 上安装 MySQL
linux·mysql·ubuntu
7***q6085 小时前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos
q***61416 小时前
从MySQL迁移到PostgreSQL的完整指南
数据库·mysql·postgresql
q***82916 小时前
windows同时安装两个不同版本的Mysql
windows·mysql·adb
小羊在奋斗6 小时前
MySQL表的约束:从基础到核心(附场景+案例)
android·数据库·mysql