Recently, when I installed MySQL in Docker, I found that the database time was 8 hours different from the system time. Linux server time: Enter mysql and enter date as follows It turns out that the two time zones are different. Because the MySQL container is installed in Docker, the incorrect MySQL time should be caused by the host Docker. After searching the data, I found that the default time zone of Docker is zone 0. In fact, this will cause a lot of trouble to the installed container, such as inaccurate execution log records. There are two solutions: Method 1: Copy the localtime of the host
Note: Due to time zone issues, the above command may report the following error
View this file It was found that this file referenced an address Solution: Switch Command
Then restart the container
Method 2: Shared host localtime Specify startup parameters when creating a container and mount the localtime file into the container
The problem of inconsistent time zones between the two is solved. This is the end of this article about the inconsistency between mysql time and system time in docker. For more related docker time inconsistency content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of the code for implementing six sieve styles using HTML grid layout
JavaScript to achieve the source code download ad...
Preface "High Performance MySQL" mentio...
Table of contents SSH protocol SSH Connection pro...
1. Data backup 1. Use mysqldump command to back u...
Docker is a management tool that uses processes a...
Read uncommitted example operation process - Read...
Without further ado, I'll go straight to the ...
The Kubernetes team recently announced that it wi...
Table of contents Preface 1. Extract data 2. Alia...
Introduction Memcached is a distributed caching s...
Table of contents Basic instructions and usage An...
Preface As Linux operation and maintenance engine...
This article shares the installation and configur...
Encapsulate el-dialog as a component When we use ...
The overall architecture of NGINX is characterize...