# MySQL

UI Bakery allows you to easily connect to a MySQL database with no need for additional layers like APIs or third-party services.

## Configuration

### Prerequisites

If your database is hosted behind a Firewall, you need to add our [IP addresses](https://docs.uibakery.io/concepts/data-sources#whitelisting-ip-addresses) to the Firewall whitelist.

### Connecting the data source

1. On the **Data sources** page, click **Connect**, and select *MySQL* in the Data sources list.
2. Specify all the required credentials and click **Test connection** to check whether the data source can be connected.
3. Finally, click **Connect Datasource** to complete the setup.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2Fod4s4cqhhkXc9hX9H2DV%2FCleanShot%202025-04-22%20at%2016.06.58%402x-min.png?alt=media&#x26;token=63797b70-04b8-499d-9c30-fd993381dd47" alt=""><figcaption></figcaption></figure>

UI Bakery will extract the database structure and store column types. This data will be used to suggest the proper [table columns and form field types](https://docs.uibakery.io/concepts/components/work-with-components/field-types-and-types-recognition).

If you need to be able to override the default data source database with a custom value in an action, you can enable the **Allow override database name in action** setting.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FZy3SCVt1R5SiXyQyW6P5%2FCleanShot%202025-04-22%20at%2016.12.13%402x-min.png?alt=media&#x26;token=84de3d69-9dac-4391-929e-c9b1136e0a4a" alt=""><figcaption></figcaption></figure>

Once enabled, when configuring the action, you will be able to specify a custom database. In case a database is not specified, the default data source database will be used.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FkztLPcFVQKZ0Oi3sd5Di%2FCleanShot%202025-04-22%20at%2016.14.28%402x-min.png?alt=media&#x26;token=b52d72ca-57fa-4bca-a9c1-b78652688c49" alt=""><figcaption></figcaption></figure>

## Usage

Once you have established the connection between UI Bakery and MySQL, you can access its data - load it and send it back.&#x20;

The following *Action steps* are supported with MySQL:

* [Load Table](https://docs.uibakery.io/reference/working-with-actions/load-table-action)
* [Load Row](https://docs.uibakery.io/reference/working-with-actions/load-row-action)
* [Create Row](https://docs.uibakery.io/reference/working-with-actions/create-row-action)
* [Bulk Create Rows](https://docs.uibakery.io/reference/working-with-actions/bulk-create-rows-action)
* [Update Row](https://docs.uibakery.io/reference/working-with-actions/update-row-action)
* [Delete Row](https://docs.uibakery.io/reference/working-with-actions/delete-row-action)
* [Bulk Delete Rows](https://docs.uibakery.io/reference/working-with-actions/bulk-delete-rows-action)
* [SQL Query](https://docs.uibakery.io/reference/working-with-actions/sql-query)
