我想使用 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 themysql.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/