Docker - 启动 MySQL 闪退解决方案

问题描述

docker run --name=master -p 3306:3306 -d mysql

启动后发现闪退。查看日志

root@ubuntuhexo:# docker logs master
2022-11-11 08:03:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-11-11 08:03:05+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-11-11 08:03:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-11-11 08:03:05+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specifiedYou need to specify one of the following as an environment variable:- MYSQL_ROOT_PASSWORD- MYSQL_ALLOW_EMPTY_PASSWORD- MYSQL_RANDOM_ROOT_PASSWORD

明显日志上说没有指定密码。加入密码后

docker run --name=master -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql
2022-11-11 08:04:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-11-11 08:04:29+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-11-11 08:04:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.31-1.el8 started.
2022-11-11 08:04:29+00:00 [Note] [Entrypoint]: Initializing database files
2022-11-11T08:04:29.772339Z 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.
2022-11-11T08:04:29.772424Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.31) initializing of server in progress as process 80
2022-11-11T08:04:29.777358Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-11-11T08:04:33.614888Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-11-11T08:04:37.621895Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2022-11-11 08:04:41+00:00 [Note] [Entrypoint]: Database files initialized
2022-11-11 08:04:41+00:00 [Note] [Entrypoint]: Starting temporary server
2022-11-11T08:04:42.321690Z 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.
2022-11-11T08:04:42.341394Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 131
2022-11-11T08:04:42.401390Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-11-11T08:04:45.844897Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-11-11T08:04:46.575024Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-11-11T08:04:46.575058Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-11-11T08:04:46.575741Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2022-11-11T08:04:46.584621Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2022-11-11T08:04:46.584640Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.31'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server - GPL.
2022-11-11 08:04:46+00:00 [Note] [Entrypoint]: Temporary server started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.2022-11-11 08:04:50+00:00 [Note] [Entrypoint]: Stopping temporary server
2022-11-11T08:04:50.284571Z 10 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.31).
2022-11-11T08:04:51.346488Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31)  MySQL Community Server - GPL.
2022-11-11 08:04:52+00:00 [Note] [Entrypoint]: Temporary server stopped2022-11-11 08:04:52+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.2022-11-11T08:04:52.504332Z 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.
2022-11-11T08:04:52.505313Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1
2022-11-11T08:04:52.509649Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-11-11T08:04:52.625646Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-11-11T08:04:52.755430Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-11-11T08:04:52.755480Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-11-11T08:04:52.756754Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2022-11-11T08:04:52.770087Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2022-11-11T08:04:52.770112Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.31'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.

启动成功,登录MySQL

docker exec -it master /bin/bash
bash-4.4# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.31 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/592746.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

系列五、搭建Naco(集群版)

一、搭建Naco(集群版) 1.1、前置说明 (1)64位Red Hat7 Linux 系统; (2)64位JDK1.8;备注:如果没有安装JDK,请参考【系列二、Linux中安装JDK】 (3&…

pyDAL一个python的ORM(6) pyDAL常用运算

&#xff08;1&#xff09; 、&#xff01; 等于&#xff0c;不等于 db(db.person.dept marketing).select(db.person.ALL) db(db.person.dept ! marketing).select(db.person.ALL) &#xff08;2&#xff09; >、>、<、< &#xff08;适用于数值、时间类型…

安装jupyter notebook,jupyter notebook的简单使用

借助anaconda安装jupyter notebook&#xff0c;先下载anaconda然后在Anaconda Prompt中输入命令&#xff1a; 输入"jupyter notebook",在默认浏览器中打开jupyter notebook。 输入"jupyter notebook --no-browser"&#xff0c;启动服务器&#xff0c;但不打…

《论文阅读》基于情绪-原因转换图的共情回复生成

《论文阅读》基于情绪-原因转换图的共情回复生成 前言摘要模型架构图构建回复概念预测回复生成前言 今天为大家带来的是《EMPATHETIC RESPONSE GENERATION VIA EMOTION CAUSE TRANSITION GRAPH》 出版: 时间:2023.2.23 类型:共情对话生成 关键词:图网络;共情回复;情绪…

多粒度在研究中的应用

FontDiffuser: One-Shot Font Generation via Denoising Diffusion with Multi-Scale Content Aggregation and Style Contrastive Learning 存在的问题 现有的字体生成方法虽然取得了令人满意的性能&#xff0c;但在处理复杂字和风格变化较大的字符(尤其是中文字符)时&#x…

无边界支付:数字货币如何改变跨境电商?

在全球数字化的浪潮中&#xff0c;数字货币的崛起成为跨境电商领域的一场革命。本文将深入探讨数字货币如何重新定义支付体系&#xff0c;对跨境电商带来的影响以及未来可能的发展方向。 数字货币的崛起 随着比特币等数字货币的逐渐走俏&#xff0c;传统支付体系的边界逐渐被打…

TinyEngine 服务端正式开源啦!!!

背景介绍 TinyEngine 低代码引擎介绍 随着企业对于低代码开发平台的需求日益增长&#xff0c;急需一个通用的解决方案来满足各种低代码平台的开发需求。正是在这种情况下&#xff0c;低代码引擎应运而生。它是一种通用的开发框架&#xff0c;通过对低代码平台系统常用的功能进…

数脉观察二丨 详解CroPoolv2.0锁仓收益机制 文末附锁仓教程

1月1日元旦佳节期间&#xff0c;CyberVein基金会支持打造的CroPoolv2.0最新版本正式上线&#xff0c;获得了圈内媒体和知名KOL多方的关注&#xff0c;在Staking领域掀起了热议&#xff0c;用户可以前往CroPool.net进行锁仓体验。 CroPool v2.0新增“锁仓”功能板块&#xff0c…

泊松分布与二项分布的可加性

泊松分布与二项分布的可加性 泊松分布的可加性 例 : 设 X , Y X,Y X,Y 相互独立 , X ∼ P ( λ 1 ) X\sim P(\lambda_1) X∼P(λ1​) , Y ∼ P ( λ 2 ) Y\sim P(\lambda_2) Y∼P(λ2​) , 求证 Z X Y ZXY ZXY 服从参数为 λ 1 λ 2 \lambda_1 \lambda_2 λ1​λ2​ …

AI:104-基于深度学习的课堂变革与教学策略

🚀点击这里可直接跳转到本专栏,可查阅顶置最新的指南宝典~ 🎉🎊🎉 你的技术旅程将在这里启航! 从基础到实践,深入学习。无论你是初学者还是经验丰富的老手,对于本专栏案例和项目实践都有参考学习意义。 ✨✨✨ 每一个案例都附带有在本地跑过的关键代码,详细讲解…

qt下载与安装

下载安装包网址&#xff1a; Index of /qt/official_releases/online_installers/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror https://download.qt.io/archive/qt/ 安装&#xff0c;一路next 先不管他&#xff0c;直接下一步

代表团坐车 - 华为OD统一考试

OD统一考试(B卷) 分值: 100分 题解: Java / Python / C++ 题目描述 某组织举行会议,来了多个代表团同时到达,接待处只有一辆汽车可以同时接待多个代表团,为了提高车辆利用率,请帮接待员计算可以坐满车的接待方案输出方案数量。 约束: 一个团只能上一辆车,并且代表团…

两个眼前一亮的工作!已开源,可在线体验!

大家好&#xff0c;我是阿潘&#xff0c;2024 年&#xff0c;新年首个工作日&#xff0c;公司引来组织架构调整&#xff0c;两个工程师和一个产品并入业务线&#xff0c;直面业务大佬的压榨&#xff01; 第一天就搞大事情&#xff0c;希望新的一年&#xff0c;我们都能迎来爆发…

介绍一下 MVC MVVM

1. 什么是MVVM? 在MVVM框架下 视图和模型是不能直接通信 的&#xff0c;只能通过ViewModel进行交互&#xff0c;它能够监 听到数据的变化&#xff0c;然后通知视图进行自动更新&#xff0c;而当用户操作视图时&#xff0c;VM也能监听到视图 的变化&#xff0c;然后通知数据做相…

python中,将txt文件转换为csv文件的几种方法

假设有一个文本文件 data.txt 内容如下&#xff1a; Name, Age, City John, 25, New York Alice, 30, San Francisco Bob, 28, Los Angeles 方法一、使用内置的 csv 模块&#xff1a; import csv# 读取txt文件 txt_file_path data.txt csv_file_path data.csvwith open(tx…

android c++打印堆栈

比如在BufferQueueConsumer.cpp打印堆栈 diff --git a/frameworks/native/libs/gui/Android.bp b/frameworks/native/libs/gui/Android.bp index f734582377..b86ad34ee2 100644 --- a/frameworks/native/libs/gui/Android.bp b/frameworks/native/libs/gui/Android.bp -146…

【elfboard linux开发板】7.i2C工具应用与aht20温湿度寄存器读取

1. I2C工具查看aht20的温湿度寄存器值 1.1 原理图 传感器通过IIC方式进行通信&#xff0c;连接的为IIC1总线&#xff0c;且设备地址为0x38&#xff0c;实际上通过后续iic工具查询&#xff0c;这个设备是挂载在iic-0上 1.2 I2C工具 通过i2c工具可以实现查询i2c总线、以及上面…

Mac环境下反编译apk

Mac环境下反编译apk 安装反编译工具dex2jar&#xff1a;[官网下载](https://sourceforge.net/projects/dex2jar/)JD-GUI&#xff1a;[官网下载](https://jd-gui.apponic.com/) 实操1. 将需要反编译的 .apk 文件放在下载的 dex2jar 文件夹目录下2. 使用 cd /xxx/dex2jar-2.0 命令…

基于pytorch 的psnr和ssim计算

基于pytorch 的psnr和ssim计算&#xff1a; import math import numpy as np from pytorch_msssim import ssim, ms_ssim, SSIM, MS_SSIM import datetime import os import sysdef calc_psnr(sr, hr):diff (sr - hr) / 255.00mse diff.pow(2).mean()psnr -10 * math.log1…

【Linux】根文件系统添加root密码

1. 问题 量产时&#xff0c;制作根文件系统&#xff0c;并添加root密码。 2. 开发板设置 2.1 在开发板中设置root密码 sudo passwd root# 根据提示输入密码和确认密码2.2 调试串口开启密码验证 设置好后&#xff0c;发现ssh登录需要密码&#xff0c;但是调试串口依然不需要…