MySQL database global Read only and session read-only problem resolution

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.