Home  >  Article  >  Database  >  How to modify mysql time

How to modify mysql time

WBOY
WBOYOriginal
2022-01-12 11:04:307375browse

Method: 1. Use the "sudo cat my.cnf" command to view the "my.cnf" file; 2. Use the "vim mysqld.cnf" command to edit the file content and add "default-time_zone = '8:00'" statement; 3. Restart mysql to make the new time take effect.

How to modify mysql time

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to modify mysql time

View my.cnf file

Command:

cd /etc/mysql/
sudo cat my.cnf

How to modify mysql time

Enter the mysql.conf.d folder

Command:

cd /etc/mysql/mysql.conf.d/

How to modify mysql time

Edit the mysqld.cnf file

Command:

sudo vim mysqld.cnf

How to modify mysql time

##Add the following content in the [mysqld] area

default-time_zone = '+8:00'

How to modify mysql time##Restart mysql The new time zone takes effect

Command:

sudo /etc/init.d/mysql restart

How to modify mysql timeRecommended learning:

mysql video tutorial

The above is the detailed content of How to modify mysql time. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn