# MySQL

> Sync tables from MySQL, MariaDB or Aurora into your warehouse on a schedule with a read-only user: setup steps, limits and how it works.

Source: https://tini.so/docs/data/mysql

Orcabase copies tables from a MySQL database into your DuckDB warehouse on a schedule. It works for MySQL, MariaDB and Amazon Aurora (MySQL). Unlike Postgres, MySQL is synced rather than queried live.

## Before you start

- The database’s host, port (usually 3306) and database name.
- A user Orcabase can log in as. A read-only user is enough (below).
- The database has to accept connections from the internet. If it only allows known IP addresses, [message us](https://linkedin.com/company/tinilab) for the address to allow.
- A DuckDB warehouse in Orcabase to sync into, and the **Admin** role in your organization.

## Create a read-only user

```sql
CREATE USER 'orcabase_readonly'@'%' IDENTIFIED BY 'choose-a-long-random-password';
GRANT SELECT ON your_database.* TO 'orcabase_readonly'@'%';
```

> **Important: No spaces or quotes**
>
> The host, database, username and password can’t contain spaces or quote marks (`'` or `"`). Pick a password without them.

## Sync the database

1. **Pick MySQL**

   Go to **Sync data → Add source** and pick **MySQL**, under **Built into Orcabase**.

2. **Enter the connection details**

   Fill in **Host**, **Port**, **Database**, **Username** and **Password**, pick your warehouse under **Sync into**, and click **Connect**. Orcabase connects from the warehouse itself, so a successful connect means syncs will work too.

3. **Choose tables and a schedule**

   Tick the tables to sync, choose a **Schema** (for example `shop`) and a frequency, then click **Start syncing**.

## How it works

- Each sync copies every selected table in full and swaps the new copy in at once. See [How a built-in sync works](https://tini.so/docs/data/sync#how-it-works).
- Orcabase only reads from MySQL. Nothing is ever written back.
- Addresses that point inside Orcabase’s own network (like `localhost` or private IP ranges) are refused. Use your database’s public address.
- Very large tables take longer, since each sync copies them in full. Sync only the tables you need, and sync big ones less often.

---

Previous: [Google Sheets](https://tini.so/docs/data/google-sheets.md) · Next: [More apps with Fivetran](https://tini.so/docs/data/fivetran.md)

All docs: https://tini.so/llms.txt
