Leif160519的blog Leif160519的blog

——————

目录
关于容器时区设置和mysql数据库自己的时区设置
/    

关于容器时区设置和mysql数据库自己的时区设置

设置容器的时区,需要在docker-compose.yml中添加

environment:
      - TZ=Asia/Shanghai

而数据库的时区设置编码设置就可以,当然也可以在mysql服务既设置容器时区,又设置数据库时区。不冲突。

command: [
            '--character-set-server=utf8mb4',
            '--collation-server=utf8mb4_unicode_ci',
            '--default-time-zone=+8:00'
    ]

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题关于容器时区设置和mysql数据库自己的时区设置
作  者Leif160519
出  处https://github.icu/articles/2019/08/29/1567039075803.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!