You can now query
InnoDB tables where the MySQL
data directory is on read-only media, by enabling the
option at server startup.
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
do a slow shutdown.
To enable read-only mode for an entire MySQL instance, specify the following configuration options at server startup:
If the instance is on read-only media such as a DVD or CD, or
/var directory is not writeable by
This mode of operation is appropriate in situations such as:
Distributing a MySQL application, or a set of MySQL data, on a read-only storage medium such as a DVD or CD.
Multiple MySQL instances querying the same data directory simultaneously, typically in a data warehousing configuration. You might use this technique to avoid bottlenecks that can occur with a heavily loaded MySQL instance, or you might use different configuration options for the various instances to tune each one for particular kinds of queries.
Querying data that has been put into a read-only state for security or data integrity reasons, such as archived backup data.
This feature is mainly intended for flexibility in distribution and deployment, rather than raw performance based on the read-only aspect. See Section 18.104.22.168.3, “Optimizations for Read-Only Transactions” for ways to tune the performance of read-only queries, which do not require making the entire server read-only.
When the server is run in read-only mode through the
InnoDB features and components are
reduced or turned off entirely:
buffering is done, in particular no merges from the
change buffer. To make sure the change buffer is empty when
you prepare the instance for read-only operation, disable
and do a slow
All background threads other than I/O read threads are turned off. As a consequence, a read-only instance cannot encounter any deadlocks.
Information about deadlocks, monitor output, and so on is not
written to temporary files. As a consequence,
INNODB STATUS does not produce any output.
Changes to configuration option settings that would normally change the the behavior of write operations, have no effect when the server is in read-only mode.
Copyright © 1997, 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices