Backup error caused by MySQLumask

Source: Internet
Author: User
However, MySQL has 700 permissions on the newly created database directory and 660 permissions on the data table file, which makes us confused. Does MySQL depend on the value set by the system? Reference

However, MySQL has 700 permissions on the newly created database directory and 660 permissions on the data table file, which makes us confused. Does MySQL depend on the value set by the system? Reference

Backup tools are limited to xtrabackup (2.0 +)

Umask is no stranger to everyone. It sets the default permission for files (directories). Generally, the permission for newly created directories is 755, and the permission for files is 644;

However, MySQL has 700 permissions on the newly created database directory and 660 permissions on the data table file, which makes us confused. Does MySQL depend on the value set by the system? Reference document: MySQL UMASK determines the database directory and file permissions by two variables UMASK UMASK_DIR. UMASK is the opposite of umask in Linux. in Linux, umask is the inverse mask of permissions, UMASK specifies the number of permissions;

You can set UMASK UMASK_DIR to set the default permissions for MySQL File Creation (MySQL needs to be restarted );

Why does MySQL need to control some variables to implement permission control (this is unknown and may be related to security )?

Precautions caused by UMASK:

Backup: When xtrabackup is used for backup, if the system user is not root or mysql, it only backs up the database directories that have the permission to access. If you do not have the permission, it will not report an error, ca (if the first database directory of the backup has no access permission, an error is reported)

Solution: Change the database directory permission to 755 or change the UMASK_DIR value;

Related reading:

Implementation of MySQL backup and recovery

Summary of three methods for MySQL backup and recovery

MySQL backup and restoration (views and stored procedures)

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.