当前位置:网站首页>Docker MySQL solves time zone problems
Docker MySQL solves time zone problems
2022-07-06 09:56:00 【Learn from Tao Ge】
Preface
MySQL The current time for inserting data in is less 8 Hours , Check the information on the Internet and know that there is no time zone , The system time zone used .
Through the command
show variables like "%time_zone%"
You can view the time zone :
Changing configuration files my.cnf:
[mysqld]
default-time-zone='+08:00'
And then restart MySQL, Check it again time_zone:
attach docker-compose.yml:
my_mysql:
image: mysql:8.0
container_name: my_mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1
restart: always
volumes:
- /root/jzt/docker/mysql/data:/var/lib/mysql/ # mapping mysql Data directory of to host machine , Save the data
- /root/jzt/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf # hold mysql The configuration file of is mapped to the corresponding directory of the container
- /root/jzt/docker/mysql/logs:/logs
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: xxx
# Initialize user ( It can't be root Will report a mistake , You need to grant permissions to new users later )
MYSQL_USER: xxx
# User password
MYSQL_PASSWORD: xxx
边栏推荐
- MapReduce instance (VI): inverted index
- [deep learning] semantic segmentation - source code summary
- CANoe下载地址以及CAN Demo 16的下载与激活,并附录所有CANoe软件版本
- CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
- 068. Find the insertion position -- binary search
- 面试突击62:group by 有哪些注意事项?
- AI的路线和资源
- 为什么大学单片机课上51+汇编,为什么不直接来STM32
- 【深度学习】语义分割:论文阅读:(CVPR 2022) MPViT(CNN+Transformer):用于密集预测的多路径视觉Transformer
- Take you back to spark ecosystem!
猜你喜欢
学习单片机对社会的帮助是很大的
五月集训总结——来自阿光
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
四川云教和双师模式
Some thoughts on the study of 51 single chip microcomputer
cmooc互联网+教育
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
How can I take a shortcut to learn C language in college
【深度学习】语义分割:论文阅读(NeurIPS 2021)MaskFormer: per-pixel classification is not all you need
Some thoughts on the study of 51 single chip microcomputer
随机推荐
Cap theory
Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
在CANoe中通过Panel面板控制Test Module 运行(高级)
单片机如何从上电复位执行到main函数?
听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
The real future of hardware engineers may not be believed by you if I say so
嵌入式開發中的防禦性C語言編程
美疾控中心:美国李斯特菌疫情暴发与冰激凌产品有关
Why is 51+ assembly in college SCM class? Why not come directly to STM32
Yarn organizational structure
Hard core! One configuration center for 8 classes!
Configure system environment variables through bat script
CANoe不能自动识别串口号?那就封装个DLL让它必须行
Selection of software load balancing and hardware load balancing
018. Valid palindromes
History of object recognition
Pointer learning
The replay block of canoe still needs to be combined with CAPL script to make it clear
17 医疗挂号系统_【微信支付】
Bugku web guide