mysql - 如何激活命名时区

标签 mysql azure timezone azure-cli

我想使用 azure cli 自动安装和配置 mysql 服务器。

使用azure mysql server create安装效果很好,但是使用azure mysql server configuration set -n time_zone --value Europe/Paris的配置由于以下原因而失败错误:

部署失败。相关 ID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx。配置“time_zone”的值“Europe/Paris”无效。允许的值为 '[+|-][0]{0,1}[0-9]:[0-5][0-9]|[+|-][1][0-2]:[ 0-5][0-9]|系统'。

正如我在mysql docs中读到的那样我可以启用命名时区执行以下 sql SET GLOBAL time_zone = timezone;,但不幸的是我的用户需要 super 权限才能成功,这是 impossible in azure
另一种方法是运行 mysql_tzinfo_to_sql,但这不能使用 azure cli。

还有其他方法可以激活命名时区吗?

最佳答案

来自the Azure DB for MySQL documentation :

Populating the time zone tables
The time zone tables on your server can be populated by calling the mysql.az_load_timezone stored procedure from a tool like the MySQL command line or MySQL Workbench.

CALL mysql.az_load_timezone();

另外,在 this doc (您在问题中链接到):

Upon initial deployment, an Azure for MySQL server includes systems tables for time zone information, but these tables are not populated. The time zone tables can be populated by calling the mysql.az_load_timezone stored procedure from a tool like the MySQL command line or MySQL Workbench.

关于mysql - 如何激活命名时区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63573298/

相关文章:

java - JPA 中的多对多查询

MySQL CASE 带有 COUNT 查询并添加另一列

javascript - Azure Node SDK 的文档(非命令行)?

c# - 日期时间本地化。任何标准/最佳实践

java - SimpleDateFormat 适用于 IST 时区,但不适用于 JST 时区

time - 向用户显示时间和时区信息(什么,而不是如何)

mysql - ColdFusion 与 MySQL 数据库通信的问题

mysql - EXPLAIN SELECT..,为什么 TYPE = ALL?

azure - 如何将现有 MVC5 网站转换为 Web 角色

c# - 连接到 blob 和 sql 存储的 Azure 函数