首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在MYSQL中插入timzone泊松. how?

如何在MYSQL中插入timzone泊松. how?
EN

Database Administration用户
提问于 2018-12-17 10:30:51
回答 1查看 236关注 0票数 0

我了解了如何将时区插入MYSQL,如下所示:

在MySQL的sys数据库中找不到时区表

但是,在输入显示数据库之后,除了显示mysql>之外,没有响应。

因此,我想澄清如何将timzone泊松. the插入MYSQL。

我正在使用mysql工作台和MySQL8.0.13服务器。窗口10. Tks

EN

回答 1

Database Administration用户

发布于 2018-12-21 23:19:44

首先下载5.7+的文件。解压缩zip文件并从命令提示符导航到解压缩文件夹。

代码语言:javascript
复制
D:\MySQL_FILES>unzip timezone_2018g_posix_sql.zip
Archive:  timezone_2018g_posix_sql.zip
   creating: timezone_2018g_posix_sql/
  inflating: timezone_2018g_posix_sql/timezone_posix.sql

D:\MySQL_FILES>cd timezone_2018g_posix_sql

D:\MySQL_FILES\timezone_2018g_posix_sql>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| employees          |
| information_schema |
| mysql              |
| performance_schema |
| sakila             |
| sys                |
+--------------------+
6 rows in set (0.03 sec)

mysql> use mysql;
Database changed
mysql> source timezone_posix.sql

脚本成功完成后,运行一些测试。

代码语言:javascript
复制
mysql> select sysdate();
+---------------------+
| sysdate()           |
+---------------------+
| 2018-12-21 17:07:28 |
+---------------------+
1 row in set (0.00 sec)

mysql> SELECT CONVERT_TZ(SYSDATE(),'utc','America/Los_Angeles') utc_la;
+---------------------+
| utc_la              |
+---------------------+
| 2018-12-21 09:07:35 |
+---------------------+
1 row in set (0.00 sec)

mysql> SELECT CONVERT_TZ(SYSDATE(),'utc','America/New_York') utc_ny;
+------------------------------------------------+
| utc_ny                                         |
+------------------------------------------------+
| 2018-12-21 12:07:41                            |
+------------------------------------------------+
1 row in set (0.00 sec)
票数 0
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/225141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档