当前位置:网站首页>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.
边栏推荐
- 8.Haproxy 搭建Web集群
- 杭电多校-Slipper-(树图转化+虚点建图)
- 10 Convolutional Neural Networks for Deep Learning 3
- share总结
- Implementing a server-side message active push solution based on SSE
- Introduction to mq application scenarios
- Metaverse "Drummer" Unity: Crazy expansion, suspense still exists
- Reproduce 20-character short domain name bypass
- 3000字,一文带你搞懂机器学习!
- 高效IO模型
猜你喜欢

8. Haproxy builds a web cluster

2022杭电多校联赛第五场 题解

软件测试如何系统规划学习呢?

base address: environment variable

6-port full Gigabit Layer 2 network managed industrial Ethernet switch Gigabit 2 optical 4 electrical fiber self-healing ERPS ring network switch

The Shell function

Stop behind.

Converts XML tags to TXT format (voc conversion for yolo convenient training)

7-3 LVS+Keepalived Cluster Description and Deployment

mysql索引笔记
随机推荐
基于 SSE 实现服务端消息主动推送解决方案
大型连锁百货运维审计用什么软件好?有哪些功能?
4-way two-way HDMI integrated business high-definition video optical transceiver 8-way HDMI high-definition video optical transceiver
技术解析|如何将 Pulsar 数据快速且无缝接入 Apache Doris
42. 接雨水
2.15 keil使用电脑端时间日期
How to keep the source code confidential in the development under the burning scenario
烧录场景下开发如何进行源代码保密工作
"Introduction to nlp + actual combat: Chapter 8: Using Pytorch to realize handwritten digit recognition"
Take care of JVM performance optimization (own note version)
Eight guiding principles to help businesses achieve digital transformation success
2022杭电多校联赛第五场 题解
Enterprise live broadcast is on the rise: Witnessing focused products, micro-like embracing ecology
[Skill] Using Sentinel to achieve priority processing of requests
高效IO模型
if,case,for,while
PHP高级开发案例(1):使用MYSQL语句跨表查询无法导出全部记录的解决方案
数据集类型转换—TFRecords文件
8. Haproxy builds a web cluster
SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropri