Use a local database such as MySQL in Retool Cloud

October 25, 2024

To connect a local MySQL database to Retool Cloud, which can't directly access local resources, you can use ngrok to tunnel your local environment and expose your MySQL database to Retool's cloud service.

Here's how you can do it:

Step-by-step guide

1. Set up ngrok

Download and install ngrok, a tool that helps expose local services to the internet via a secure tunnel.

2. Expose your MySQL database

Run the following command to open a tunnel for MySQL (default port 3306):

ngrok tcp 3306

This command creates a public tcp URL, which ngrok will display. This URL serves as the "host" for your MySQL database, which you can now use in Retool.

For detailed instructions, refer to the ngrok documentation on MySQL.

3. Configure Retool

4. Testing & development only

This method is perfect for development or testing environments but is not recommended for production due to security concerns, as it exposes your local machine to the internet.


This approach provides a quick and easy way to connect a local database to Retool Cloud for testing or development purposes.

Have a business need or a project in mind?

We help ambitious companies ride the change