Linux Learning Note: read-only parameters

Source: Internet
Author: User

With read-only, you can leave the entire mysqld instance in a read-only state, but be aware that there is no limit to read-only for super users with full permissions. Therefore, we can only provide access to ordinary users.


Read-only can be used for master-slave synchronization from the library, can be easily implemented from the library security.


The method of setting is simple, there are two kinds of

1) Enter read-only in my.cnf [mysqld] and start the service;

2) Online input

mysql> set global read_only= ' on '; Query OK, 0 rows Affected (0.00 sec) mysql> Show variables like ' read_only '; +---------------+-------+| variable_name | Value |+---------------+-------+| Read_Only | On |+---------------+-------+1 row in Set (0.00 sec)

It is important to note that in the configuration file, the name of the parameter is used more than the cross-bar, and in the case of online input, the parameter name is used more underlined _; In addition, when online input, this parameter is the global parameter, so the method of setting is set global


Attempting to modify data from another client will prompt the MySQL server to be running in a read-only state.

[Email protected] ~]# mysql-uweb-pweb123-h 192.168.5.41-e "Delete from mydb.student where name= ' webtest ';" ERROR 1290 (HY000) at line 1:the MySQL Server was running with the--read-only option so it cannot execute this statement


Linux Learning Note: read-only parameters

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.