Azure Database for MySQL 中的限制Limitations in Azure Database for MySQL

Note

将要查看的是 Azure Database for MySQL 的新服务。You are viewing the new service of Azure Database for MySQL. 若要查看经典 MySQL Database for Azure 的文档,请访问此页To view the documentation for classic MySQL Database for Azure, please visit this page.

以下各部分介绍了数据库服务中的容量、存储引擎支持、特权支持、数据操作语句支持和功能限制。The following sections describe capacity, storage engine support, privilege support, data manipulation statement support, and functional limits in the database service. 另请参阅适用于 MySQL 数据库引擎的常规限制Also see general limitations applicable to the MySQL database engine.

服务器参数Server parameters

多个常用服务器参数的最小值和最大值由定价层和 vCore 确定。The minimum and maximum values of several popular server parameters are determined by the pricing tier and vCores. 请参阅下表中的限制。Refer to the below tables for limits.

max_connectionsmax_connections

定价层Pricing Tier vCore(s)vCore(s) 默认值Default value 最小值Min value 最大值Max value
基本Basic 11 5050 10 个10 5050
基本Basic 22 100100 10 个10 100100
常规用途General Purpose 22 300300 10 个10 600600
常规用途General Purpose 44 625625 10 个10 12501250
常规用途General Purpose 88 12501250 10 个10 25002500
常规用途General Purpose 1616 25002500 10 个10 50005000
常规用途General Purpose 3232 50005000 10 个10 1000010000
常规用途General Purpose 6464 1000010000 10 个10 2000020000
内存优化Memory Optimized 22 600600 10 个10 800800
内存优化Memory Optimized 44 12501250 10 个10 25002500
内存优化Memory Optimized 88 25002500 10 个10 50005000
内存优化Memory Optimized 1616 50005000 10 个10 1000010000
内存优化Memory Optimized 3232 1000010000 10 个10 2000020000

当连接数超出限制时,可能会收到以下错误:When connections exceed the limit, you may receive the following error:

错误 1040 (08004):连接过多ERROR 1040 (08004): Too many connections

Important

为了获得最佳体验,我们建议你使用 ProxySQL 之类的连接池程序来有效地管理连接。For best experience, we recommend that you use a connection pooler like ProxySQL to efficiently manage connections.

创建与 MySQL 的新客户端连接需要时间,一旦建立,这些连接就会占用数据库资源,即使在空闲时也是如此。Creating new client connections to MySQL takes time and once established, these connections occupy database resources, even when idle. 大多数应用程序都请求许多短期连接,这加剧了这种情况。Most applications request many short-lived connections, which compounds this situation. 其结果是可用于实际工作负荷的资源减少,从而导致性能下降。The result is fewer resources available for your actual workload leading to decreased performance. 减少空闲连接并重用现有连接的连接池会有助于避免这种情况。A connection pooler that decreases idle connections and reuses existing connections will help avoid this. 若要了解如何设置 ProxySQL,请访问我们的博客文章To learn about setting up ProxySQL, visit our blog post.

query_cache_sizequery_cache_size

默认会禁用查询缓存。The query cache is turned off by default. 若要启用查询缓存,请配置 query_cache_type 参数。To enable the query cache, configure the query_cache_type parameter.

查看 MySQL 文档详细了解此参数。Review the MySQL documentation to learn more about this parameter.

Note

查询缓存从 MySQL 5.7.20 开始已遭弃用,并且已在 MySQL 8.0 中删除The query cache is deprecated as of MySQL 5.7.20 and has been removed in MySQL 8.0

定价层Pricing Tier vCore(s)vCore(s) 默认值Default value 最小值Min value 最大值Max value
基本Basic 11 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
基本Basic 22 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
常规用途General Purpose 22 00 00 1677721616777216
常规用途General Purpose 44 00 00 3355443233554432
常规用途General Purpose 88 00 00 6710886467108864
常规用途General Purpose 1616 00 00 134217728134217728
常规用途General Purpose 3232 00 00 134217728134217728
常规用途General Purpose 6464 00 00 134217728134217728
内存优化Memory Optimized 22 00 00 3355443233554432
内存优化Memory Optimized 44 00 00 6710886467108864
内存优化Memory Optimized 88 00 00 134217728134217728
内存优化Memory Optimized 1616 00 00 134217728134217728
内存优化Memory Optimized 3232 00 00 134217728134217728

sort_buffer_sizesort_buffer_size

查看 MySQL 文档详细了解此参数。Review the MySQL documentation to learn more about this parameter.

定价层Pricing Tier vCore(s)vCore(s) 默认值Default value 最小值Min value 最大值Max value
基本Basic 11 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
基本Basic 22 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
常规用途General Purpose 22 524288524288 3276832768 41943044194304
常规用途General Purpose 44 524288524288 3276832768 83886088388608
常规用途General Purpose 88 524288524288 3276832768 1677721616777216
常规用途General Purpose 1616 524288524288 3276832768 3355443233554432
常规用途General Purpose 3232 524288524288 3276832768 3355443233554432
常规用途General Purpose 6464 524288524288 3276832768 3355443233554432
内存优化Memory Optimized 22 524288524288 3276832768 83886088388608
内存优化Memory Optimized 44 524288524288 3276832768 1677721616777216
内存优化Memory Optimized 88 524288524288 3276832768 3355443233554432
内存优化Memory Optimized 1616 524288524288 3276832768 3355443233554432
内存优化Memory Optimized 3232 524288524288 3276832768 3355443233554432

join_buffer_sizejoin_buffer_size

查看 MySQL 文档详细了解此参数。Review the MySQL documentation to learn more about this parameter.

定价层Pricing Tier vCore(s)vCore(s) 默认值Default value 最小值Min value 最大值Max value
基本Basic 11 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
基本Basic 22 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
常规用途General Purpose 22 262144262144 128128 268435455268435455
常规用途General Purpose 44 262144262144 128128 536870912536870912
常规用途General Purpose 88 262144262144 128128 10737418241073741824
常规用途General Purpose 1616 262144262144 128128 21474836482147483648
常规用途General Purpose 3232 262144262144 128128 42949672954294967295
常规用途General Purpose 6464 262144262144 128128 42949672954294967295
内存优化Memory Optimized 22 262144262144 128128 536870912536870912
内存优化Memory Optimized 44 262144262144 128128 10737418241073741824
内存优化Memory Optimized 88 262144262144 128128 21474836482147483648
内存优化Memory Optimized 1616 262144262144 128128 42949672954294967295
内存优化Memory Optimized 3232 262144262144 128128 42949672954294967295

max_heap_table_sizemax_heap_table_size

查看 MySQL 文档详细了解此参数。Review the MySQL documentation to learn more about this parameter.

定价层Pricing Tier vCore(s)vCore(s) 默认值Default value 最小值Min value 最大值Max value
基本Basic 11 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
基本Basic 22 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
常规用途General Purpose 22 1677721616777216 1638416384 268435455268435455
常规用途General Purpose 44 1677721616777216 1638416384 536870912536870912
常规用途General Purpose 88 1677721616777216 1638416384 10737418241073741824
常规用途General Purpose 1616 1677721616777216 1638416384 21474836482147483648
常规用途General Purpose 3232 1677721616777216 1638416384 42949672954294967295
常规用途General Purpose 6464 1677721616777216 1638416384 42949672954294967295
内存优化Memory Optimized 22 1677721616777216 1638416384 536870912536870912
内存优化Memory Optimized 44 1677721616777216 1638416384 10737418241073741824
内存优化Memory Optimized 88 1677721616777216 1638416384 21474836482147483648
内存优化Memory Optimized 1616 1677721616777216 1638416384 42949672954294967295
内存优化Memory Optimized 3232 1677721616777216 1638416384 42949672954294967295

tmp_table_sizetmp_table_size

查看 MySQL 文档详细了解此参数。Review the MySQL documentation to learn more about this parameter.

定价层Pricing Tier vCore(s)vCore(s) 默认值Default value 最小值Min value 最大值Max value
基本Basic 11 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
基本Basic 22 在基本层中不可配置Not configurable in Basic tier 不适用N/A 不适用N/A
常规用途General Purpose 22 1677721616777216 10241024 6710886467108864
常规用途General Purpose 44 1677721616777216 10241024 134217728134217728
常规用途General Purpose 88 1677721616777216 10241024 268435456268435456
常规用途General Purpose 1616 1677721616777216 10241024 536870912536870912
常规用途General Purpose 3232 1677721616777216 10241024 10737418241073741824
常规用途General Purpose 6464 1677721616777216 10241024 10737418241073741824
内存优化Memory Optimized 22 1677721616777216 10241024 134217728134217728
内存优化Memory Optimized 44 1677721616777216 10241024 268435456268435456
内存优化Memory Optimized 88 1677721616777216 10241024 536870912536870912
内存优化Memory Optimized 1616 1677721616777216 10241024 10737418241073741824
内存优化Memory Optimized 3232 1677721616777216 10241024 10737418241073741824

time_zonetime_zone

可以通过从 MySQL 命令行或 MySQL Workbench 等工具调用 mysql.az_load_timezone 存储过程来填充时区表。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. 有关如何调用存储过程并设置全局时区或会话级时区,请参阅文章 Azure 门户Azure CLIRefer to the Azure portal or Azure CLI articles for how to call the stored procedure and set the global or session-level time zones.

存储引擎支持Storage engine support

支持Supported

不支持Unsupported

特权支持Privilege support

不支持Unsupported

  • DBA 角色:许多服务器参数和设置可能会无意中导致服务器性能下降或使 DBMS 的 ACID 属性无效。DBA role: Many server parameters and settings can inadvertently degrade server performance or negate ACID properties of the DBMS. 因此,为了维护产品级别的服务完整性和 SLA,此服务不公开 DBA 角色。As such, to maintain the service integrity and SLA at a product level, this service does not expose the DBA role. 默认用户帐户(在创建新的数据库实例时构造)允许该用户执行托管数据库实例中的大部分 DDL 和 DML 语句。The default user account, which is constructed when a new database instance is created, allows that user to perform most of DDL and DML statements in the managed database instance.
  • SUPER 特权:SUPER 特权同样也受到限制。SUPER privilege: Similarly SUPER privilege is also restricted.
  • DEFINER:需要创建并限制超级权限。DEFINER: Requires super privileges to create and is restricted. 如果使用备份导入数据,请在执行 mysqldump 时手动删除或使用 --skip-definer 命令删除 CREATE DEFINER 命令。If importing data using a backup, remove the CREATE DEFINER commands manually or by using the --skip-definer command when performing a mysqldump.

数据操作语句支持Data manipulation statement support

支持Supported

  • 支持 LOAD DATA INFILE,但必须指定 [LOCAL] 参数,并将其定向到 UNC 路径(通过 SMB 装载的 Azure 存储空间)。LOAD DATA INFILE is supported, but the [LOCAL] parameter must be specified and directed to a UNC path (Azure storage mounted through SMB).

不支持Unsupported

  • SELECT ... INTO OUTFILE

功能限制Functional limitations

缩放操作Scale operations

  • 目前不支持动态缩放到“基本”定价层或从该层动态缩放。Dynamic scaling to and from the Basic pricing tiers is currently not supported.
  • 不支持减小服务器存储大小。Decreasing server storage size is not supported.

服务器版本升级Server version upgrades

  • 目前不支持在主要数据库引擎版本之间进行自动迁移。Automated migration between major database engine versions is currently not supported. 如果要升级到下一个主版本,请进行转储并将其还原到使用新引擎版本创建的服务器。If you would like to upgrade to the next major version, take a dump and restore it to a server that was created with the new engine version.

时间点还原Point-in-time-restore

  • 使用 PITR 功能时,将使用与新服务器所基于的服务器相同的配置创建新服务器。When using the PITR feature, the new server is created with the same configurations as the server it is based on.
  • 不支持还原已删除的服务器。Restoring a deleted server is not supported.

VNet 服务终结点VNet service endpoints

  • 只有常规用途和内存优化服务器才支持 VNet 服务终结点。Support for VNet service endpoints is only for General Purpose and Memory Optimized servers.

存储大小Storage size

  • 有关每个定价层的存储大小限制,请参阅定价层Please refer to pricing tiers for the storage size limits per pricing tier.

当前已知的问题Current known issues

  • 建立连接后,MySQL 服务器实例显示错误的服务器版本。MySQL server instance displays the wrong server version after connection is established. 若要获取正确的服务器实例引擎版本,请使用 select version(); 命令。To get the correct server instance engine version, use the select version(); command.

后续步骤Next steps