> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bondata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL

> Connect BonData to MySQL to sync your database tables

MySQL is one of the world's most popular open-source relational databases, widely used for web applications, analytics, and enterprise systems. With BonData, you can connect directly to your MySQL database to read, enrich, and act on your data within Agent workflows.

## Database Connection

BonData connects directly to your MySQL database using standard connection credentials.

### Step 1: Prepare Your Database

Ensure your MySQL server is accessible from BonData's IP addresses. You may need to:

1. Configure your firewall to allow connections on port 3306 (or your custom port)
2. Update the `bind-address` in your MySQL configuration if needed

### Step 2: Create a Read-Only User (Recommended)

For security, create a dedicated read-only user for BonData:

```sql theme={null}
-- Create a user for BonData (update 'your_ip' as needed)
CREATE USER 'bondata_user'@'%' IDENTIFIED BY 'your_secure_password';

-- Grant select access on the database
GRANT SELECT ON your_database.* TO 'bondata_user'@'%';

-- Apply the changes
FLUSH PRIVILEGES;
```

### Step 3: Gather Connection Details

Collect the following information:

* **Host**: Your database server hostname or IP address
* **Port**: Usually 3306
* **Database**: The name of the database to connect to
* **User**: The username created above
* **Password**: The password for the user

### Step 4: Connect in BonData

Enter your connection details in BonData to establish the connection.

## Required Fields

| Field    | Description                            |
| -------- | -------------------------------------- |
| Host     | Database server hostname or IP address |
| Port     | Database server port (default: 3306)   |
| Database | Name of the database to connect to     |
| User     | Database username                      |
| Password | Database password                      |

<Note>
  BonData supports SSL connections for enhanced security. Contact support if you need to configure SSL certificates.
</Note>

## Available Data

Once connected, BonData can sync:

* **Tables** - All tables the user has SELECT access to
* **Views** - Database views accessible to the user
* **Custom Queries** - Run custom SQL queries to extract specific data
