skip-external-locking--mysql Configuration Instructions

Source: Internet
Author: User

In MySQL configuration file my.cnf, there is a one-line skip-external-locking parameter, which is "Skip external lock". According to the official explanation of the MySQL development website, external-locking is used for locking MyISAM data tables under multi-process conditions.

If you have more than one server using the same database directory (not recommended), then each server must turn on external locking;

Parameter interpretation

When external locking (external-locking) is in effect, each process to access the data table must wait for the previous process to finish and unlock. Because servers often need to wait to unlock data tables, external locking in a single-server environment can degrade MySQL performance. So in the source of many Linux distributions, skip-external-locking is used by default in the MySQL configuration file to avoid external locking.

When skip-external-locking is used, in order to use MYISAMCHK to check the database or to repair and optimize the table, you must ensure that the MySQL server does not use the tables that need to be manipulated during this process. If you do not stop the server, you must run it at least first

1 mysqladmin flush-tables

command, otherwise the data table may appear to be abnormal.

Parameter usage Instructions

If you are a multi-server environment and want to open the external locking feature, comment out this line

1 # skip-external-locking

If it is a single-server environment, disable it and use the following statement

1 skip-external-locking

Precautions

In the old version of MySQL, this parameter is written as:

1 skip-locking

If you still use this notation in the new version of MySQL configuration, it may appear:

[Warning] ' –skip-locking ' is deprecated and would be removed in a future release. Please use ' –skip-external-locking ' instead.

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.