要知道当前时间,我们可以使用 now() 函数和 SELECT 语句。查询是 如下 -
mysql> SELECT now();
执行上述查询后,我们将获得当前时间。以下是输出 -
+---------------------+ | now() | +---------------------+ | 2018-10-06 12:57:25 | +---------------------+ 1 row in set (0.02 sec)
To set the time zone, we can use the command SET. The syntax is 如下 -
mysql> SET time_zone = "Some value";
Now I am applying the above query to set the time zone. The query is 如下 -
mysql> SET time_zone = "+9:50"; Query OK, 0 rows affected (0.00 sec)
我们也可以借助 SET 命令进行全局设置 -
mysql> set global time_zone="+9:00"; Query OK, 0 rows affected (0.00 sec)
以上就是如何设置MySQL的时区?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号