Home > Database > Mysql Tutorial > How to modify mysql time

How to modify mysql time

WBOY
Release: 2022-01-12 11:04:30
Original
7426 people have browsed it

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
Copy after login

How to modify mysql time

Enter the mysql.conf.d folder

Command:

cd /etc/mysql/mysql.conf.d/
Copy after login

How to modify mysql time

Edit the mysqld.cnf file

Command:

sudo vim mysqld.cnf
Copy after login

How to modify mysql time

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

default-time_zone = '+8:00'
Copy after login

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

Command:

sudo /etc/init.d/mysql restart
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template