# MySQL MySQL Permissions

Source: https://userguide.qualytics.io/source-datastore/datastore/jdbc/mysql/permissions/

> **Info: Permissions in your MySQL**
>
> The permissions on this page are granted in your own MySQL, to the account Qualytics connects with, by whoever administers MySQL at your company. They let Qualytics connect the datastore and read your data, and write to it when it is an enrichment datastore. They are not Qualytics roles or team permissions. To know which Qualytics user role (**Admin**, **Manager**, or **Member**) and team permission you need to connect the datastore in Qualytics, see [Source Datastore Permissions](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/permissions/).

Qualytics connects to MySQL over JDBC. It uses standard JDBC metadata APIs to discover databases, tables, columns, and primary keys. MySQL uses a database where other engines use a schema, so the database name you provide in the connection form is the scope for all operations.

## Minimum MySQL Permissions (Source Datastore)

| Permission | Purpose |
| --- | --- |
| `SELECT` | Read data from all tables for profiling and scanning |
| `SHOW VIEW` | Read view definitions for metadata discovery |
| `PROCESS` | View active queries (used by the JDBC driver for connection metadata) |

## Additional Permissions for an Enrichment Datastore

When MySQL is used as an enrichment datastore, the following additional permissions are required so Qualytics can write its outputs, which are named from the linked source's prefix (for example `_tpch_failed_checks`):

| Permission | Purpose |
| --- | --- |
| `CREATE` | Create enrichment outputs |
| `ALTER` | Modify enrichment table schemas during version migrations |
| `INSERT` | Write anomaly records, scan results, and check metrics |
| `UPDATE` | Update enrichment records during rescans |
| `DELETE` | Replace records when a run overwrites an output |
| `DROP` | Replace an output when a run overwrites it or its schema changes. Unlinking never removes written data |

## Example: Source Datastore User (Read-Only)

Replace `<database_name>` and `<password>` with your actual values.

```sql
-- Create a dedicated read-only user
CREATE USER ‘qualytics_read’@’%’ IDENTIFIED BY ‘<password>’;

-- Grant read access to all tables and views
GRANT SELECT, SHOW VIEW ON <database_name>.* TO ‘qualytics_read’@’%’;

-- Grant the global PROCESS privilege (required by the JDBC driver for connection metadata)
GRANT PROCESS ON *.* TO ‘qualytics_read’@’%’;

-- Apply the changes
FLUSH PRIVILEGES;
```

## Example: Enrichment Datastore User (Read-Write)

```sql
-- Create a dedicated read-write user
CREATE USER ‘qualytics_readwrite’@’%’ IDENTIFIED BY ‘<password>’;

-- Grant full data manipulation and table management
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, SHOW VIEW ON <database_name>.* TO ‘qualytics_readwrite’@’%’;

-- Grant the global PROCESS privilege (required by the JDBC driver for connection metadata)
GRANT PROCESS ON *.* TO ‘qualytics_readwrite’@’%’;

-- Apply the changes
FLUSH PRIVILEGES;
```

> **Note**
>
> Qualytics automatically filters out system databases (`information_schema`, `mysql`, `performance_schema`, `sys`) during schema discovery. You do not need to restrict access to these databases manually.

*Last updated: November 16, 2026.*
