Specifying Permissions for Schema (Data) Directories and Tables

You are viewing an old version of this article. View the current version here.

By default MariaDB uses the following modes for creating directories and files.

Mode forDefault ModeEnvironment variable
Files0660 (same as -rw-rw----)UMASK
Directories0700 (same as drwx------)UMASK_DIR

By setting the environment variables before you start mysqld or mysqld_safe you can specify the mode for files and directories.

Note that the environment variables are modes specified in octal and OR:de with the default value (as the default value is the minimum value needed for mysqld to work).

In other words, if you would run the following in the shell:

set UMASK=001
export UMASK

mysqld would use the mode 0661 when creating new files.

If you start the server with systemctl:


systemctl edit mariadb

An editor opens.

This creates a file named override.conf in the directory /etc/systemd/system/mariadb.service.d/

Write the desired value in the editor.


After saving this file, you need to reload the service definitions before the changes will be recognized by MariaDB, thus:

systemctl daemon-reload
systemctl restart mariadb


Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.