centos 7 修复mysql,快速修复Centos7 系统时区!
注意:修改Linux系統的時區以后,再安裝jvm,jvm默認會使用系統的時區。
如果系統時區設置錯誤,安裝jvm后,再修改系統的時區,但jvm的時區仍然用不變,除非添加jvm的啟動參數:-D user.timezone=GMT+08
方法1: timedatectl set-timezone Asia/Shanghai
# timedatectl
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.
Local time: Mon 2016-11-21 01:52:42 EST
Universal time: Mon 2016-11-21 06:52:42 UTC
RTC time: Mon 2016-11-21 06:52:42
Time zone: America/New_York (EST, -0500)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2016-11-06 01:59:59 EDT
Sun 2016-11-06 01:00:00 EST
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2017-03-12 01:59:59 EST
Sun 2017-03-12 03:00:00 EDT
設置時區為CST(東8區)
# timedatectl set-timezone Asia/Shanghai
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.
Local time: Mon 2016-11-21 14:52:59 CST
Universal time: Mon 2016-11-21 06:52:59 UTC
RTC time: Mon 2016-11-21 06:52:59
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
[root@localhost ~]#
方法2:TZ環境變量的方式
修改用戶目錄下的.bash_profile,在文件末尾追加:
TZ='Asia/Shanghai'; export TZ
推出登錄后,重新登錄,date命令可以查看效果。
希望與廣大網友互動??
點此進行留言吧!
總結
以上是生活随笔為你收集整理的centos 7 修复mysql,快速修复Centos7 系统时区!的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 康强电子是龙头吗 半导体封装材料细分行业
- 下一篇: 基金持有不满几天有惩罚性赎回费