18. Connecting Your Local Database
Last updated
Last updated
This guide will help you connect your local database to AI2sql using ngrok. By following these steps, you can securely expose your local database to AI2sql, enabling seamless integration.
Go to the .
Download the appropriate version for your operating system.
Extract the downloaded file to a directory accessible from the command line.
Sign up for a free ngrok account at .
Copy your auth token from the ngrok dashboard.
Open your terminal and run the following command, replacing <your_auth_token>
with the token you copied:
For a local MySQL database running on port 3306, run the following command:
After starting the tunnel, ngrok will provide a forwarding URL in the format tcp://0.tcp.ngrok.io:12345
.
Copy this URL; you will need it to connect AI2sql to your local database.
Log in to your AI2sql account.
Go to the database connectors section within AI2sql.
Click on "Add New Connection" or a similar option.
Database URL: Paste the ngrok forwarding URL you copied earlier (e.g., tcp://0.tcp.ngrok.io:12345
).
Username: Enter your local database username.
Password: Enter your local database password.
Database Name: Enter the name of your local database.
Save the new database connection settings.
Use the test connection feature (if available) to ensure everything is set up correctly.
You can now use your local database in AI2sql as if it were a cloud-based database.
Enjoy the features and benefits of AI2sql with your local data securely connected.
Tunnel Not Working: Ensure ngrok is running and you have copied the correct forwarding URL.
Authentication Failed: Double-check your database username and password.
Connection Timeout: Verify that your local database is running and accessible.
Check the AI2sql help center for additional support.
Visit the for more detailed information.