In read-only mode, it remains possible to change tables created with the TEMPORARY  keyword using DML statements. Changes made with DDL statements are not permitted, just as with permanent tables. 

The READ WRITE  and READ ONLY  access modes also may be specified for an individual transaction using the START TRANSACTION  statement. 

## Transaction Characteristic Scope 

You can set transaction characteristics globally, for the current session, or for the next transaction only: 

•With the GLOBAL  keyword: 

•The statement applies globally for all subsequent sessions. 

•Existing sessions are unaffected. 

•With the SESSION  keyword: 

•The statement applies to all subsequent transactions performed within the current session. 

•The statement is permitted within transactions, but does not affect the current ongoing transaction. 

•If executed between transactions, the statement overrides any preceding statement that sets the next- transaction value of the named characteristics. 

•Without any SESSION  or GLOBAL  keyword: 

•The statement applies only to the next single transaction performed within the session. 

•Subsequent transactions revert to using the session value of the named characteristics. 

•The statement is not permitted within transactions: 

mysql> START TRANSACTION; Query OK, 0 rows affected (0.02 sec) mysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ERROR 1568 (25001): Transaction characteristics can’t be changed while a transaction is in progress 

A change to global transaction characteristics requires the CONNECTION_ADMIN  privilege (or the deprecated SUPER  privilege). Any session is free to change its session characteristics (even in the middle of a transaction), or the characteristics for its next transaction (prior to the start of that transaction). 

To set the global isolation level at server startup, use the --transaction-isolation= level  option on the command line or in an option file. Values of level  for this option use dashes rather than spaces, so the permissible values are READ-UNCOMMITTED , READ-COMMITTED , REPEATABLE-READ , or SERIALIZABLE . 

Similarly, to set the global transaction access mode at server startup, use the --transaction-read- only  option. The default is OFF  (read/write mode) but the value can be set to ON  for a mode of read only. 

For example, to set the isolation level to REPEATABLE READ  and the access mode to READ WRITE , use these lines in the [mysqld]  section of an option file: 

[mysqld] transaction-isolation = REPEATABLE-READ transaction-read-only = OFF 

