I launched a small demo last week and found that the default time in the database log file is 8h different from the system time.
This pot is very annoying. What if there are problems in the follow-up?
Let’s take a look at the default log file last week. The
actual time is 16:21, but the log is 08:21, which is obviously less than 8h.
How to break?
Just add a sentence in the configuration file
log_timestamps=SYSTEM
[mysqld]
lower_case_table_names=1
basedir = /pe/mysql-dm/mysql-5.7.24/
datadir = /app/data
port = 3306
socket = /app/tmp/mysql.sock
character-set-server=utf8
log-error = /app/data/mysqld.log
pid-file = /app/data/mysqld.pid
#加上下面这一行,保证日志跟系统时间保持一致
log_timestamps=SYSTEM
Found that the time in the mysql log has been updated to Beijing time
Get it done
More exciting, stay tuned!