# MariaDB

Bobby Tables connects to MariaDB through the MySQL wire protocol, keeps MariaDB as the saved provider, and opens each connection in a SQL workspace.

## Where to find it

| Action | How |
| --- | --- |
| Choose MariaDB | `New connection`, `⌘N` (`Ctrl+N`), then `MariaDB` under `Choose a provider` |
| Fill the form from a URL | `Use connection URL` with a `mariadb://` URL, then `Fill fields` |
| Default port | `3306` |
URLs the app copies use `mariadb://`, so change the scheme to `mysql://` for tools that only know MySQL. Searching the chooser for `maria` also finds it.

## Connecting

The form asks for `Host`, `Port`, `User`, `Database (optional)` and `Password`, and notes that the connection `Uses 2 server connections`. `Test connection` reports the version string, which names MariaDB, and refuses a MySQL or TiDB server selected as MariaDB. Verified TLS, client certificates, SSH tunnels and `mysql_native_password` accounts work as they do for MySQL, as described in [SSH and TLS](https://bobbytables.app/docs/ssh-and-tls). `Open in read-only mode` sets a read-only session transaction and disables editing.

## What works

- Browse databases, tables, views, stored routines, triggers and scheduled events in the [table grid](https://bobbytables.app/docs/table-data).
- Stage inserts, updates and deletes, then commit them in one transaction, as described in [Editing](https://bobbytables.app/docs/editing).
- Change columns, indexes and keys in the [Structure](https://bobbytables.app/docs/structure) tab, one DDL statement at a time.
- Take a consistent [snapshot](https://bobbytables.app/docs/snapshots) with the built-in engine or an installed `mariadb-dump`.
- Draw a [schema diagram](https://bobbytables.app/docs/schema-diagram) from declared foreign keys.
- Format result columns with [result directives](https://bobbytables.app/docs/result-directives).
- Stop a running statement with `Cancel`, `⌘.` (`Ctrl+.`), which sends `KILL QUERY`.
- Run `Explain`, `⌘⇧E` (`Ctrl+Shift+E`), or `Explain Analyze`, `⌘⇧⌥E` (`Ctrl+Shift+Alt+E`), which return JSON, in the [SQL editor](https://bobbytables.app/docs/sql-editor).

## Engine notes

MariaDB keeps some catalog details in different places, and Bobby Tables reads what the connected server understands. Functional index expressions show as their columns only, and a snapshot infers view order from the view bodies and says so in the script. For an account that holds only `SELECT`, the diagram rebuilds keys from `STATISTICS` and `KEY_COLUMN_USAGE` and reports referential actions as unknown.

## Good to know

- A MariaDB connection saved under the MySQL provider keeps working. Edit it and choose MariaDB so the list reads correctly.
- When the snapshot engine is `mariadb-dump`, options it does not accept are left out.

## Related

- [MySQL](https://bobbytables.app/docs/mysql.md)
- [Snapshots](https://bobbytables.app/docs/snapshots.md)
- [Schema diagram](https://bobbytables.app/docs/schema-diagram.md)
- [Engines, file sources and platforms](https://bobbytables.app/docs/engines.md)
