Skip to content
Snippets Groups Projects
Unverified Commit 832aa969 authored by Jeff Bruemmer's avatar Jeff Bruemmer Committed by GitHub
Browse files

docs - add MariaDB page (#45763)

parent d3a51585
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,8 @@ The databases listed below have official drivers maintained by the Metabase team
- [BigQuery](./connections/bigquery.md) (Google Cloud Platform)
- [Druid](./connections/druid.md)
- [MongoDB (recommend version 4.2 or higher)](./connections/mongodb.md)
- [MySQL (recommend version 8.0.33 or higher, as well as MariaDB version 10.4 or higher)](./connections/mysql.md)
- [MariaDB](./connections/mariadb.md)
- [MySQL](./connections/mysql.md)
- [Oracle](./connections/oracle.md)
- [PostgreSQL](./connections/postgresql.md)
- [Presto](./connections/presto.md)
......
---
title: MariaDB
---
# MariaDB
> We recommend using MariaDB version 10.4 or higher.
To add a database connection, click on the **gear** icon in the top right, and navigate to **Admin settings** > **Databases** > **Add a database**.
MariaDB shares a driver with MySQL, so select the **MySQL** driver.
## Settings
You can edit these settings at any time. Just remember to save your changes.
### Display name
The display name for the database in the Metabase interface.
### Host
Your database's IP address, or its domain name (e.g., esc.mydatabase.com).
### Port
The database port. E.g., 3306.
### Username
The database username for the account that you want to use to connect to your database. You can set up multiple connections to the same database using different user accounts to connect to the same database, each with different sets of [privileges](../users-roles-privileges.md).
### Password
The password for the username that you use to connect to the database.
### Use a secure connection (SSL)
You can paste your server's SSL certification chain.
### Use an SSH tunnel
See our [guide to SSH tunneling](../ssh-tunnel.md).
### Unfold JSON Columns
JSON folding is not supported for MariaDB databases.
### Additional JDBC connection string options
You can append options to the connection string that Metabase uses to connect to your database.
### Re-run queries for simple explorations
Turn this option **OFF** if people want to click **Run** (the play button) before applying any [Summarize](../../questions/query-builder/introduction.md#grouping-your-metrics) or filter selections.
By default, Metabase will execute a query as soon as you choose an grouping option from the **Summarize** menu or a filter condition from the [drill-through menu](https://www.metabase.com/learn/questions/drill-through). If your database is slow, you may want to disable re-running to avoid loading data on each click.
### Choose when Metabase syncs and scans
Turn this option **ON** to manage the queries that Metabase uses to stay up to date with your database. For more information, see [Syncing and scanning databases](../sync-scan.md).
#### Database syncing
If you've selected **Choose when syncs and scans happen** > **ON**, you'll be able to set:
- The frequency of the [sync](../sync-scan.md#how-database-syncs-work): hourly (default) or daily.
- The time to run the sync, in the timezone of the server where your Metabase app is running.
#### Scanning for filter values
Metabase can scan the values present in each field in this database to enable checkbox filters in dashboards and questions. This can be a somewhat resource-intensive process, particularly if you have a very large database.
If you've selected **Choose when syncs and scans happen** > **ON**, you'll see the following options under **Scanning for filter values**:
- **Regularly, on a schedule** allows you to run [scan queries](../sync-scan.md#how-database-scans-work) at a frequency that matches the rate of change to your database. The time is set in the timezone of the server where your Metabase app is running. This is the best option for a small database, or tables with distinct values that get updated often.
- **Only when adding a new filter widget** is a great option if you want scan queries to run on demand. Turning this option **ON** means that Metabase will only scan and cache the values of the field(s) that are used when a new filter is added to a dashboard or SQL question.
- **Never, I'll do this manually if I need to** is an option for databases that are either prohibitively large, or which never really have new values added. Use the [Re-scan field values now](../sync-scan.md#manually-scanning-column-values) button to run a manual scan and bring your filter values up to date.
### Periodically refingerprint tables
> Periodic refingerprinting will increase the load on your database.
Turn this option **ON** to scan a sample of values every time Metabase runs a [sync](../sync-scan.md#how-database-syncs-work).
A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
## Syncing records that include JSON
JSON schema inference doesn't work with MariaDB, due to implementation differences between MySQL and MariaDB.
## Further reading
- [MySQL](./mysql.md)
- [Managing databases](../../databases/connecting.md)
- [Metadata editing](../../data-modeling/metadata-editing.md)
- [Models](../../data-modeling/models.md)
- [Setting data access permissions](../../permissions/data.md)
......@@ -6,7 +6,7 @@ redirect_from:
# MySQL
> We recommend using MySQL version 8.0.33 or higher, though older versions may work. If you're using MariaDB: version 10.4 or higher.
> We recommend using MySQL version 8.0.33 or higher.
To add a database connection, click on the **gear** icon in the top right, and navigate to **Admin settings** > **Databases** > **Add a database**.
......@@ -89,7 +89,7 @@ A fingerprinting query examines the first 10,000 rows from each column and uses
## Connecting to MySQL 8+ servers
Metabase uses the MariaDB connector to connect to MariaDB and MySQL servers. The MariaDB connector does not currently support MySQL 8's default authentication plugin, so in order to connect, you'll need to change the plugin used by the Metabase user to
Metabase uses the MariaDB connector to connect to MySQL servers. The MariaDB connector lacks support for MySQL 8's default authentication plugin. In order to connect, you'll need to change the plugin used by the Metabase user:
```
mysql_native_password`: `ALTER USER 'metabase'@'%' IDENTIFIED WITH mysql_native_password BY 'thepassword';
......@@ -142,8 +142,6 @@ DROP USER 'metabase'@'localhost';
The problem is that, if the keys in the JSON vary record to record, the first five hundred rows may not capture all the keys used by JSON objects in that JSON field. To get Metabase to infer all the JSON keys, you'll need to add the additional keys to the JSON objects in the first five hundred rows.
**This JSON "schema" inference doesn't work with MariaDB**, due to implementation differences between MySQL and MariaDB.
## Raising a MySQL Docker container of MySQL 8+
If you are spinning up a new MySQL container, and:
......@@ -176,6 +174,7 @@ mysql:
## Further reading
- [MariaDB](./mariadb.md)
- [Managing databases](../../databases/connecting.md)
- [Metadata editing](../../data-modeling/metadata-editing.md)
- [Models](../../data-modeling/models.md)
......
......@@ -163,7 +163,7 @@ Syntax: `Median(column)`.
Example: `Median([Age])` would find the midpoint age where half of the ages are older, and half of the ages are younger.
Databases that don't support `median`: SQLite, Vertica, SQL server, MySQL. Presto only provides approximate results.
Databases that don't support `median`: MariaDB, MySQL, SQLite, Vertica, and SQL Server. Presto only provides approximate results.
Related: [Min](#min), [Max](#max), [Average](#average).
......@@ -185,7 +185,7 @@ Syntax: `Percentile(column, percentile-value)`
Example: `Percentile([Score], 0.9)` would return the value at the 90th percentile for all values in that column.
Databases that don't support `percentile`: H2, MySQL, SQL Server, SQLite, Vertica. Presto only provides approximate results.
Databases that don't support `percentile`: H2, MariaDB, MySQL, SQL Server, SQLite, Vertica. Presto only provides approximate results.
### Share
......@@ -761,7 +761,7 @@ See [Offset](./expressions/offset.md).
case(contains([Title], 'Wallet'), true, false)
```
### Database limitations
## Database limitations
Limitations are noted for each aggregation and function above, and here there are in summary:
......@@ -771,7 +771,9 @@ Limitations are noted for each aggregation and function above, and here there ar
**MongoDB**: `regexextract`
**MySQL/MariaDB**: `Median`, `Percentile`.
**MariaDB**: `Median`, `Percentile`.
**MySQL**: `Median`, `Percentile`.
**Presto**: Only provides _approximate_ results for `Median` and `Percentile`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment