How does mysql view and modify the time zone?
Method 1
#View time zone show variables like "%time_zone%";set global time_zone = '+8: 00'; ##Modify mysql global time zone to Beijing time, i.e. our East 8 zone set time_zone = '+8: 00'; ##Modify current session time zone flush privileges; #Effective immediately
Method 2
linux
# vim /etc/my.cnf ##Add default-time_zone = '+8: 00'# /etc/init.d/mysqld restart ##Restart mysql to make the new time zone take effect
windows
Modify the configuration file my.ini
Path C:\ProgramData\MySQL\MySQL Server 5.7
ProgramData is a hidden folder
Add under [mysqld]
#Set default time zone default-time-zone='+08: 00'
Restart mysql in cmd as administrator
net stop mysqlnet start mysql
If it's wrong,
Invalid service name. Type HELNET PMSG 2185 for more help.
Error in service name Please check service name in Services
windows+r, open run, enter services.msc, find mysql services,
View service name mysql57,
net stop mysql57net start mysql57
The above is mysql view and modify the time zone method details, more please pay attention to other related articles!