14.8.2 Configuring InnoDB for Read-Only Operation (original) (raw)

14.8.2 Configuring InnoDB for Read-Only Operation

You can query InnoDB tables where the MySQL data directory is on read-only media by enabling the--innodb-read-only configuration option at server startup.

How to Enable

To prepare an instance for read-only operation, make sure all the necessary information is flushed to the data files before storing it on the read-only medium. Run the server with change buffering disabled (innodb_change_buffering=0) and do a slow shutdown.

To enable read-only mode for an entire MySQL instance, specify the following configuration options at server startup:

--innodb-temp-data-file-path=../../../tmp/ibtmp1:12M:autoextend  

Usage Scenarios

This mode of operation is appropriate in situations such as:

Note

This feature is mainly intended for flexibility in distribution and deployment, rather than raw performance based on the read-only aspect. SeeSection 8.5.3, “Optimizing InnoDB Read-Only Transactions” for ways to tune the performance of read-only queries, which do not require making the entire server read-only.

How It Works

When the server is run in read-only mode through the--innodb-read-only option, certain InnoDB features and components are reduced or turned off entirely: