ALTER DATABASE Statement In  ALTER DATABASE  statements, the  READ ONLY  option interacts with other instances of itself and with other options as follows: •An error occurs if multiple instances of  READ ONLY  conflict (for example,  READ ONLY = 1 READ ONLY = 0 ). The  READ ONLY  option cannot be enabled for these system schemas:  mysql ,  information_schema , performance_schema . •An  ALTER DATABASE  statement that contains only (nonconflicting)  READ ONLY  options is permitted even for a read-only database. •A mix of (nonconflicting)  READ ONLY  options with other options is permitted if the read-only state of the database either before or after the statement permits modifications. If the read-only state both before and after prohibits changes, an error occurs. This statement succeeds whether or not the database is read only: ALTER DATABASE mydb READ ONLY = 0 DEFAULT COLLATE utf8mb4_bin; This statement succeeds if the database is not read only, but fails if it is already read only: ALTER DATABASE mydb READ ONLY = 1 DEFAULT COLLATE utf8mb4_bin; Enabling  READ ONLY  affects all users of the database, with these exceptions that are not subject to read- only checks: •Statements executed by the server as part of server initialization, restart, upgrade, or replication. •Statements in a file named at server startup by the  init_file  system variable. • TEMPORARY  tables; it is possible to create, alter, drop, and write to  TEMPORARY  tables in a read-only database. •NDB Cluster non-SQL inserts and updates. •The database itself: • ALTER DATABASE  (except to change the  READ ONLY  option) • CREATE DATABASE • DROP DATABASE Other than for the excepted operations just listed, enabling  READ ONLY  prohibits write operations to the database and its objects, including their definitions, data, and metadata. The following list details affected SQL statements and operations: •Views: • DROP VIEW • ALTER VIEW • CREATE VIEW •Selecting from views that invoke functions with side effects. •Updating updatable views. 2472