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