MySQL mysqld the relationship between the permissions of the generated file and the Umask

Source: Internet
Author: User

Today, because of the Binlog file permissions issue, the final trace is the MySQL installation initialized to modify the permissions of the file, and then recorded:

One. By default, the MYSQLD program produces a directory where the permission is umask value is 0700, and the file's permission is umask the value is 0660.

[Email protected] ~]$ ll/export/servers/data/my3306/data/test/-ld
drwx------. 2 MySQL root 4096 June 11:19/export/servers/data/my3306/data/test/#目录 0700

[Email protected] ~]$ ll/export/servers/data/my3306/binlog/-ld #文件 0660
-RW-RW---- 1 mysql myinstall 150 September 15:12 mysql-bin.000019
-RW-RW---- 1 mysql myinstall 150 September 15:12 mysql-bin.000020

If you want to modify the permissions of the Mysqld makefile, add the environment variable to the MySQL. bash_profile. bashrc.

Export umask=0600 # or decimal value = 384, starting with 0 is octal
Export umask_dir=0750

After modification:

[Email protected] ~]$ Ll/export/servers/data/my3306/data/hhl-ld
drwx--x--- 2 mysql myinstall 4096 September 15:34/EXPORT/SERVERS/DATA/MY3306/DATA/HHL [[email protected] ~]$ Ll/ex port/servers/data/my3306/binlog/-L

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

Summary: here the umask and system umask is not a meaning, do not confuse Ah, umask variable control the permissions of the file production, pay attention to the MySQL permissions to minimize the control to select the appropriate permissions.



This article is from the My DBA life blog, so be sure to keep this source http://huanghualiang.blog.51cto.com/6782683/1557770

MySQL mysqld the relationship between the permissions of the generated file and the Umask

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.