当前位置:网站首页>There is an 8 hour difference between the docker installation of mysql and the host.
There is an 8 hour difference between the docker installation of mysql and the host.
2022-08-04 04:19:00 【sea of sperm whales】
Recently, I used docker to build a mysql container. When I started it, I found that the date inside was eight hours different from the host machine. At first, I thought it was a time zone problem of mysql, but later I found out that it was a time problem in the docker container.
Enter the host and docker and use the date command to check:
This is due to:
The host uses the CST time zone, and CST should refer to (China Shanghai Time, East Eighth District Time)
The container uses the UTC time zone, and UTC should refer to (Coordinated Universal Time, standard time)
Solution:
Because I have already started the container, I use the method of copying from the host machine to the inside of the container. If you have not run the container, it is best to mount the time file when you create the container.
docker cp /usr/share/zoneinfo/Asia/Shanghai mysql:/etc/localtimeRestart:
docker restart mysqlVerify:

has been synced.
边栏推荐
- 深度学习——以CNN服装图像分类为例,探讨怎样评价神经网络模型
- ADC噪声全面分析 -03- 利用噪声分析进行实际设计
- Gigabit 2 X light 8 electricity management industrial Ethernet switches WEB management - a key Ring Ring net switch
- Basic characteristics of TL431 and oscillator circuit
- Oracle与Postgresql在PLSQL内事务回滚的重大差异
- Tensors - Application Cases
- 缓存穿透、缓存击穿、缓存雪崩以及解决方案
- Learn iframes and use them to solve cross-domain problems
- MySQL query optimization and tuning
- 2003. 每棵子树内缺失的最小基因值 DFS
猜你喜欢

用户与用户互发红包/支付宝C2C/B2C现金红包php源码示例/H5方式/兼容苹果/安卓

基于 SSE 实现服务端消息主动推送解决方案

打造一份优雅的简历

Explain详解与实践

drools from download to postman request success

Explain detailed explanation and practice

【 observe 】 super fusion: the first mention of "calculate net nine order" evaluation model, build open prosperity of power network

Enterprise live broadcast is on the rise: Witnessing focused products, micro-like embracing ecology

高效IO模型

帮助企业实现数字化转型成功的八项指导原则
随机推荐
打造一份优雅的简历
2022杭电多校联赛第五场 题解
FPGA parsing B code----serial 3
【 observe 】 super fusion: the first mention of "calculate net nine order" evaluation model, build open prosperity of power network
XSS相关知识点
深度学习之 10 卷积神经网络3
Reproduce 20-character short domain name bypass
This Thursday evening at 19:00, the fourth live broadcast of knowledge empowerment丨The realization of equipment control of OpenHarmony smart home project
机器学习之视频学习【更新】
2022年软件测试——精选金融银行面试真题
2022 Hangzhou Electric Power Multi-School League Game 5 Solution
企业直播风起:目睹聚焦产品,微赞拥抱生态
【C语言进阶】程序环境和预处理
机器学习模型的“可解释性”
Postgresql源码(66)insert on conflict语法介绍与内核执行流程解析
Converts XML tags to TXT format (voc conversion for yolo convenient training)
Y86. Chapter iv Prometheus giant monitoring system and the actual combat, Prometheus storage (17)
嵌入式数据库开发编程MySQL(全)
数组相关 内容 解析
数据治理平台项目总结和分析