当前位置:网站首页>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.
边栏推荐
- share总结
- SQL interview Questions
- FFmpeg —— 录制麦克风声音(附源码)
- if,case,for,while
- Gigabit 2 X light 8 electricity management industrial Ethernet switches WEB management - a key Ring Ring net switch
- centos 安装postgresql13 指定版本
- 用户与用户互发红包/支付宝C2C/B2C现金红包php源码示例/H5方式/兼容苹果/安卓
- 结构体指针知识要点总结
- SQL query String field less than 10 how to check
- JVM Notes
猜你喜欢

7-1 LVS+NAT 负载均衡群集,NAT模式部署

Stop behind.

How to systematically plan and learn software testing?

Oracle与Postgresql在PLSQL内事务回滚的重大差异
![出现504怎么办?由于服务器更新导致的博客报504错误[详细记录]](/img/e0/32d78fac04dc2deb1cb1f847a7bab5.png)
出现504怎么办?由于服务器更新导致的博客报504错误[详细记录]

Y86. Chapter iv Prometheus giant monitoring system and the actual combat, Prometheus storage (17)

sql语句查询String类型字段小于10的怎么查

一文详解DHCP原理及配置

劝退背后。

【Ryerson情感说话/歌唱视听数据集(RAVDESS) 】
随机推荐
Postgresql source code (66) insert on conflict grammar introduction and kernel execution process analysis
马尔可夫链
mysql索引笔记
2003. 每棵子树内缺失的最小基因值 DFS
For Qixi Festival, I made a confession envelope with code
[Skill] Using Sentinel to achieve priority processing of requests
Oracle与Postgresql在PLSQL内事务回滚的重大差异
ADC噪声全面分析 -03- 利用噪声分析进行实际设计
数据集类型转换—TFRecords文件
Explain详解与实践
7-2 LVS+DR Overview and Deployment
【21天学习挑战赛】直接插入排序
7.LVS负载均衡群集之原理叙述
go module的介绍与应用
杭电多校-Slipper-(树图转化+虚点建图)
Introduction to mq application scenarios
初识Numpy
软件测试如何系统规划学习呢?
结构体函数练习
Functions, recursion and simple dom operations