美文网首页
时间参数

时间参数

作者: 古飞_数据 | 来源:发表于2023-09-11 15:21 被阅读0次

全局参数system_time_zone
系统时区,在MySQL启动时会检查当前系统的时区并根据系统时区设置全局参数system_time_zone的值。

The system time zone. When the server starts, it attempts to determine the time zone of the host machine automatically and uses it to set thesystem_time_zone system variable. The value does not change thereafter.

全局参数time_zone
用来设置每个连接会话的时区,默认为system时,使用全局参数system_time_zone的值

The current time zone. This variable is used to initialize the time zone for each client that connects. By default, the initial value of this is 'SYSTEM' (which means, “use the value of system_time_zone”)

参数log_timestamps
用于设置Error Log/Genaral Log/Slow Log这三种日志的时间信息。
有效值为UTC(默认)和SYSTEM(本地系统时区),当设置为system时,会使用参数system_time_zone的值。

set global time_zone='+8:00'
set global time_zone='Asia/Shanghai'


# 配置文件
default-time-zone=timezone
# 运行期间
set global time_zone = timezone


[root@localhost ~]# date -R
Mon, 11 Sep 2023 14:12:46 +0800

8.0.31 

mysql> show variables like '%time%';
+-----------------------------------+-------------------+
| Variable_name                     | Value             |
+-----------------------------------+-------------------+
| binlog_max_flush_queue_time       | 0                 |
| connect_timeout                   | 10                |
| default_password_lifetime         | 0                 |
| delayed_insert_timeout            | 300               |
| explicit_defaults_for_timestamp   | ON                |
| flush_time                        | 0                 |
| have_statement_timeout            | YES               |
| innodb_flush_log_at_timeout       | 1                 |
| innodb_lock_wait_timeout          | 50                |
| innodb_old_blocks_time            | 1000              |
| innodb_rollback_on_timeout        | OFF               |
| interactive_timeout               | 28800             |
| lc_time_names                     | en_US             |
| lock_wait_timeout                 | 31536000          |
| log_timestamps                    | UTC               |
| long_query_time                   | 10.000000         |
| max_execution_time                | 0                 |
| mysqlx_connect_timeout            | 30                |
| mysqlx_idle_worker_thread_timeout | 60                |
| mysqlx_interactive_timeout        | 28800             |
| mysqlx_port_open_timeout          | 0                 |
| mysqlx_read_timeout               | 30                |
| mysqlx_wait_timeout               | 28800             |
| mysqlx_write_timeout              | 60                |
| net_read_timeout                  | 30                |
| net_write_timeout                 | 60                |
| original_commit_timestamp         | 36028797018963968 |
| regexp_time_limit                 | 32                |
| replica_net_timeout               | 60                |
| rpl_stop_replica_timeout          | 31536000          |
| rpl_stop_slave_timeout            | 31536000          |
| slave_net_timeout                 | 60                |
| slow_launch_time                  | 2                 |
| ssl_session_cache_timeout         | 300               |
| system_time_zone                  | CST               |
| time_zone                         | SYSTEM            |
| timestamp                         | 1694402723.459469 |
| wait_timeout                      | 28800             |
+-----------------------------------+-------------------+
38 rows in set (0.01 sec)

相关文章

  • 时间参数问题

    springboot 项目 参数传递进来后,mybitis 查询出错 ### Error querying dat...

  • 46.构造时间参数以及下单购票

    构造时间参数以及下单购票 学习目标 了解 构造时间参数 了解 下单购票逻辑 5.1 构造时间参数 5.2 下单购票...

  • UILocalNotification 本地推送

    参数 时间相关参数(A组) fireDate 和 timeZone fireDate : 推送时间 timeZon...

  • STP的时间参数

    时间参数 计时器设置 在STP协议中,有Forward Delay、Hello Time、Message Age字...

  • 引用类型之Date

    new Date() 返回当前时区时间,可以加参数,如果加参数,参数也是当前时区时间。Date是基于距1970年的...

  • Postman设置参数

    一.断言&设置参数 1.正常断言 2.设置参数 3.更改参数名称 4.获取多个返回值 二、时间参数 1.添加时间戳...

  • 日期格式化

    //参数一:时间;参数二:格式; function Format(now,mask) { var d ...

  • 添加事件到系统日历

    1.这个是主要的方法添加事件到日历 1.参数一:事件名称2.参数二:开始时间3.参数三:结束时间4.参数四:位置 ...

  • Spring技巧汇总

    Spring MVC接收Date参数使用@DateTimeFormat参数格式化时间, bean对象里面的时间属性同理

  • iOS-NSTimer()

    NSTimer 每隔一定时间执行某个函数 //创建定时器//参数1.定时时间//参数2.调用方法的对象//参数3....

网友评论

      本文标题:时间参数

      本文链接:https://www.haomeiwen.com/subject/emesvdtx.html