For the release of the system is a common thing, sometimes need to isolate the changes to the database but also require the ability to read the data, for MSS SQL This is very simple, direct properties------read-only, but for MySQL this is different, We've been doing a little research today. MySQL for Singleton and instance read-only settings
Here does not introduce MySQL through the account permissions control to achieve the database read-only way, here mainly explains the database parameters control mode 1.read_only parameter resolution: This is the global parameter of MySQL, the default setting is 0 want the whole library read only need to set this parameter to 1 is set Global Read_only=1; Note: This parameter is the Super permission of the user and the thread copied from the server from the host will not be affected, so the main recommendation is to take the Super privilege from the server set to parameter 1 for MySQL rights assignment, so that the database is guaranteed to be read-only globally The READ_ONLY parameter does not apply to the temporary table, nor to the system service Insert Log table, in general, this parameter is only limited to the account does not have super privileges to modify the structure and content of the table, and has super permissions to the database updates, and so on, but one drawback is that this parameter is the global variable , and most of the production is an instance of multiple databases. Extension: tx_read_only parameter, this parameter is a global and session variable, and I tested this parameter will cause all accounts have read-only permission, and the storage engine is MyISAM, this variable is also working.
MySQL database global Read only and session read-only problem resolution