# Specifying Permissions for Schema (Data) Directories and Tables

## Default File Permissions

By default MariaDB uses the following permissions for files and directories:

| Object Type | Default Mode | Default Permissions |
| ----------- | ------------ | ------------------- |
| Files       | 0660         | -rw-rw----          |
| Directories | 0700         | drwx------          |

## Configuring File Permissions with Environment Variables

You can configure MariaDB to use different permissions for files and directories by setting the following [environment variables](/docs/server/server-management/install-and-upgrade-mariadb/configuring-mariadb/mariadb-environment-variables.md) before you start the server:

| Object Type | Environment Variable |
| ----------- | -------------------- |
| Files       | UMASK                |
| Directories | UMASK\_DIR           |

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

```
export UMASK=0640
export UMASK_DIR=0750
```

These environment variables do not set the umask. They set the default file system permissions. See [MDEV-23058](https://jira.mariadb.org/browse/MDEV-23058) for more information.

### Configuring File Permissions With systemd

If your server is started by [systemd](/docs/server/server-management/starting-and-stopping-mariadb/systemd.md), then there is a specific way to configure the umask. See [Systemd: Configuring the umask](/docs/server/server-management/starting-and-stopping-mariadb/systemd.md#configuring-the-umask) for more information.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/server-management/starting-and-stopping-mariadb/specifying-permissions-for-schema-data-directories-and-tables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
