Today I found that a program inserted an incorrect time, and the field was configured with the default value CURRENT_TIMESTAMP. I initially determined that it was a problem with the database time zone setting. Check time zone Log in to the database to view the time zone configuration: mysql> show variables like '%time_zone%'; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | EDT | | time_zone | SYSTEM | +------------------+--------+ 2 rows in set (0.00 sec)
Change time zone To change the time zone: # Only change the time zone of the current session and stop the session from being invalidated set time_zone = '+8:00'; # Modify the global time zone configuration set global time_zone = '+8:00'; flush privileges; Of course, you can also modify the configuration file (my.cnf) to achieve the configuration, but you need to restart the service. # vim /etc/my.cnf ##Add default-time_zone = '+8:00' in the [mysqld] area # /etc/init.d/mysqld restart ##Restart mysql to make the new time zone take effect By the way, unlike China, the United States has 4 time zones... Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
>>: Mini Programs use Mini Program Cloud to implement WeChat payment functions
Preface When we deploy applications to servers as...
Table of contents mysql log files binlog Binlog l...
Preface: As far as I know, currently CSS can only...
This article example shares the specific code of ...
Since I found that the push image always timed ou...
1. CSS realizes fixed width on the left and adapt...
Table of contents 1. Check whether the docker env...
Table of contents 1. Draw a circle 2. Circle move...
Today I made a Spring Festival gold coin red enve...
What is pip pip is a Python package management to...
There are four types of positioning in CSS, which...
1 Requirements Overview The data of multiple tabl...
1. The role of doctype, the difference between st...
Background Many website designs generally consist...
Table of contents 1. Use 2. Solve the problem of ...