> For the complete documentation index, see [llms.txt](https://docs.coupler.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coupler.io/sources/category/files-and-tables/mysql/best-practices.md).

# Best Practices

## Recommended setup

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Whitelist IPs before connecting</strong></td><td>Add Coupler.io's IPs (34.123.243.115, 34.170.96.92) to your firewall or security group before you create a data flow. This prevents "connection refused" errors and saves troubleshooting time.</td></tr><tr><td><strong>Use a dedicated database user</strong></td><td>Create a MySQL user specifically for Coupler.io with SELECT-only permissions. This limits the blast radius if credentials are ever compromised and makes audit logs cleaner.</td></tr><tr><td><strong>Test with a small table first</strong></td><td>Before exporting your largest or most critical table, test the connection with a smaller table to confirm everything works smoothly.</td></tr></tbody></table>

## Data refresh and scheduling

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Filter by date for large tables</strong></td><td>If exporting millions of rows, apply a date filter (e.g., last 30 days) instead of exporting all history. This speeds up exports and reduces timeout risk. You can append historical data in a separate flow if needed.</td></tr><tr><td><strong>Start with daily refreshes</strong></td><td>Run a daily schedule first to ensure exports complete reliably. Once confident, increase frequency to hourly if your business requires real-time data.</td></tr><tr><td><strong>Monitor your first few runs</strong></td><td>After scheduling a data flow, check your destination (Google Sheets, BigQuery, etc.) to confirm data is arriving correctly and in the expected format before moving on.</td></tr></tbody></table>

## Performance optimization

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Index your filtered columns</strong></td><td>If filtering on created_at, status, or user_id, ensure those columns have database indexes. This dramatically speeds up query execution and prevents timeouts.</td></tr><tr><td><strong>Export views, not complex queries</strong></td><td>If you need complex transformations, create a MySQL view and export that instead of filtering in Coupler.io. Views are pre-computed and run faster.</td></tr></tbody></table>

## Common pitfalls

{% columns %}
{% column %}
**Do**

* Whitelist IPs in your firewall or security group before connecting
* Create a dedicated MySQL user with SELECT-only permissions
* Apply date filters to large tables to avoid timeouts
* Test your first export with a manual run before scheduling
* Use indexes on columns you filter by (created\_at, status, user\_id)
  {% endcolumn %}

{% column %}
**Don't**

* Use your root or admin MySQL account — create a separate user
* Export your entire database history in one flow if it's millions of rows
* Skip firewall configuration if your database is in the cloud or behind a corporate network
* Schedule very high frequency refreshes (hourly) for large tables without testing first
* Store your MySQL password in plain text notes; use a password manager
  {% endcolumn %}
  {% endcolumns %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.coupler.io/sources/category/files-and-tables/mysql/best-practices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
