Explanation of MySQL performance parameters: Skip-External-Locking parameter introduction, mysqlskiplocking

Source: Internet
Author: User

Explanation of MySQL performance parameters: Skip-External-Locking parameter introduction, mysqlskiplocking

MySQL configuration file my. cnf contains a line of skip-external-locking parameters by default, that is, "skip external lock ". According to the official explanation of the MySQL development website, External-locking is used to lock the MyISAM data table under multi-process conditions.
If you have multiple servers using the same database directory (not recommended), you must enable external locking on each server;
 
Parameter description

When the external-locking function, to access the data table, each process must wait for the previous process to complete the operation and unlock it. Because the server often needs to wait for unlocking to access the data table, external locking may degrade MySQL performance in a single server environment. Therefore, in many Linux distributions, skip-external-locking is used by default in the MySQL configuration file to avoid external locking.
After skip-external-locking is used, to use MyISAMChk to check the database or repair or optimize the table, you must ensure that the MySQL server does not use the table to be operated during this process. If you have not stopped the server, you must at least run it first.

Copy codeThe Code is as follows:
Mysqladmin flush-tables

Command. Otherwise, an exception may occur in the data table.
 
Parameter instructions
If you want to enable the external locking feature in a multi-server environment, comment out this line.
Copy codeThe Code is as follows:
# Skip-external-locking

If it is a single server environment, disable it. Use the following statement:

Copy codeThe Code is as follows:
Skip-external-locking

Notes
In earlier versions of MySQL, this parameter is written as follows:

Copy codeThe Code is as follows:
Skip-locking

If this statement is still used in the new MySQL configuration, it may appear:
[Warning] '-skip-locking' is deprecated and will be removed in a future release. Please use'-skip-external-locking 'instead.
Error.

Original Site: http://www.bootf.com/594.html

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.