Relationship between MySQL mysqld file generation permission and UMASK

Source: Internet
Author: User

Relationship between MySQL mysqld file generation permission and UMASK

Today, because of the binlog File Permission issue, the final tracking is that the MySQL installation initialization specifies the permission for the MySQL user to generate the file, so the problem is recorded and summarized:

1. By default, the directory generated by the mysqld program has the UMASK value of 0700, And the File Permission of UMASK is 0660.

[Mysql @ localhost ~] $ Ll/export/servers/data/my3306/data/test/-ld
Drwx ------. 2 mysql root 4096 June 10 11:19/export/servers/data/my3306/data/test/# directory 0700

[Mysql @ localhost ~] $ Ll/export/servers/data/my3306/binlog/-ld # object 0660
-Rw ---- 1 mysql myinstall 150 September 24 15:12 mysql-bin.000019
-Rw ---- 1 mysql myinstall 150 September 24 15:12 mysql-bin.000020

If you want to modify the permission of mysqld to generate a file, add the environment variable to. bash_profile. bashrc of mysql.

Export UMASK = 0600 # Or the decimal value = 384. If it starts with 0, it is octal.
Export UMASK_DIR = 0750

After modification:

[Mysql @ localhost ~] $ Ll/export/servers/data/my3306/data/hhl-ld
Drwx -- x --- 2 mysql myinstall 4096 September 24 15:34/export/servers/data/my3306/data/hhl [mysql @ localhost ~] $ Ll/export/servers/data/my3306/binlog/-l

-Rw ------- 1 mysql myinstall 450 September 24 15:34 mysql-bin.000025 #0600
-Rw ------- 1 mysql myinstall 188 September 24 15:34 mysql-bin.000026

Summary: The UMASK and the system umask are not meanings. Do not confuse them. The UMASK variable controls the permissions generated by the file. Be sure to select the appropriate permissions in the mysql permission minimization control.

-------------------------------------- Split line --------------------------------------

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

-------------------------------------- Split line --------------------------------------

This article permanently updates the link address:

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.