17.1.4 使用 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.
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=
clause to the other_engine_name
CREATE TABLE
statement to avoid the error.
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;
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.
Test any replication configurations, especially if you use different MySQL versions and options on the source server and replicas.