文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 17 InnoDB 存储引擎 / 17.1 InnoDB 简介 / 17.1.4 使用 InnoDB 进行测试和基准测试
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

17.1.4 使用 InnoDB 进行测试和基准测试17.1.4 Testing and Benchmarking with InnoDB

如果 InnoDB 不是默认存储引擎,您可以通过在命令行上使用 --default-storage-engine=InnoDB 重启服务器,或者在 MySQL 服务器选项文件的 [mysqld] 部分中定义 default-storage-engine=innodb,来确定您的数据库服务器和应用程序是否可以正常使用 InnoDB。If InnoDB is not the default storage engine, you can determine if your database server and applications work correctly with InnoDB by restarting the server with --default-storage-engine=InnoDB defined on the command line or with default-storage-engine=innodb defined in the [mysqld] section of the MySQL server option file.

由于更改默认存储引擎只会影响新创建的表,请运行您的应用程序安装和设置步骤以确认一切安装正常,然后使用应用程序功能以确保数据加载、编辑和查询功能正常工作。如果一个表依赖于另一个存储引擎特有的功能,您将收到错误。在这种情况下,将 ENGINE=other_engine_name 子句添加到 CREATE TABLE 语句中以避免错误。Since changing the default storage engine only affects newly created tables, run your application installation and setup steps to confirm that everything installs properly, then exercise the application features to make sure the data loading, editing, and querying features work. If a table relies on a feature that is specific to another storage engine, you receive an error. In this case, add the ENGINE=other_engine_name clause to the CREATE TABLE statement to avoid the error.

如果您没有对存储引擎做出明确决定,并且想预览某些表在使用 InnoDB 创建时的工作情况,请对每个表执行命令 ALTER TABLE table_name ENGINE=InnoDB;。或者,为了在不影响原始表的情况下运行测试查询和其他语句,可以先复制一份:If you did not make a deliberate decision about the storage engine, and you want to preview how certain tables work when created using InnoDB, issue the command ALTER TABLE table_name ENGINE=InnoDB; for each table. Alternatively, to run test queries and other statements without disturbing the original table, make a copy:

CREATE TABLE ... ENGINE=InnoDB AS SELECT * FROM other_engine_table;

要在现实负载下评估完整应用程序的性能,请安装最新的 MySQL 服务器并运行基准测试。To assess performance with a full application under a realistic workload, install the latest MySQL server and run benchmarks.

测试完整的应用程序生命周期,从安装、重度使用到服务器重启。在数据库繁忙时杀掉服务器进程以模拟断电,并在重新启动服务器时验证数据是否成功恢复。Test the full application lifecycle, from installation, through heavy usage, and server restart. Kill the server process while the database is busy to simulate a power failure, and verify that the data is recovered successfully when you restart the server.

测试任何复制配置,尤其是当您在源服务器和副本上使用不同的 MySQL 版本和选项时。Test any replication configurations, especially if you use different MySQL versions and options on the source server and replicas.