Connect Your Local Database to AI2SQL
Use AI2SQL with databases running on localhost or inside your private network. Run the lightweight AI2SQL Connector and start working with your own tables in plain English.
Detecting your system…
Other platforms:
Why do I need the Connector?
AI2SQL runs in the cloud. A database on localhost, 127.0.0.1 or an address like 192.168.1.20 only exists inside your own machine or your company network — there is no route from the internet to it, which is why a direct connection fails no matter which credentials you enter.
The Connector turns the problem around: instead of AI2SQL reaching into your network, a small app runs where the database already lives. It reads your table and column names there, and asks AI2SQL to write the SQL. You never open a port, edit a firewall rule, or set up a tunnel.
Stays on your machine: credentials, table rows, connection details Sent to AI2SQL: your question and the table names you pick
How it works
Three steps, about two minutes, no installer.
Download the Connector
Run it on the computer that can already reach your database. One file, no installer, no admin rights.
Sign in with AI2SQL
A small window opens in your browser. Sign in with your AI2SQL account so generations use your own plan and limits.
Load your schema and ask
Enter your database details, load the schema, pick the tables you care about, and describe what you need in plain English.
Works with the databases you already run
Local SQL Server
Point the Connector at your local Microsoft SQL Server instance — typically localhost:1433 — and generate T-SQL against your real tables, including instances that only exist inside a company network.
Download the Connector →Local PostgreSQL
A PostgreSQL server on localhost:5432, in Docker, or on a machine inside your private network works the same way. Your schema is read where it already runs.
Download the Connector →Local MySQL
MySQL on localhost:3306 or a private host — load the schema and write queries in plain English without exposing the server to the internet.
Download the Connector →What you can do once your schema is loaded
AI2SQL works from your real table and column names, so you stop pasting table structures into a chat window every time you ask a question.
- ✓ Ask in plain English and get SQL for your own tables
- ✓ Generate queries that use your real column names and joins
- ✓ Explain a query someone else wrote, in plain language
- ✓ Fix an error by pasting the query and the message
- ✓ Optimize a slow query you already have
- ✓ Understand relationships between tables before you write anything
Built for real databases
If you need approval before pointing anything at a company database, this is the section to forward. Every statement below describes what the shipped Connector actually does.
- Does AI2SQL receive my database credentials?
- No. Your username and password are used by the Connector on your own machine and are not sent to AI2SQL.
- Does my data leave the network?
- No table rows are sent. AI2SQL receives your question and the names and data types of the tables you select — nothing else.
- Can I use a read-only database user?
- Yes, and we recommend it. The Connector only reads schema metadata from INFORMATION_SCHEMA. It never writes to your database.
- Does it run the SQL it generates?
- No. The generated SQL is shown to you. Running it is your decision, in your own tool.
- Does it open ports or need firewall changes?
- No. The Connector opens no inbound ports and makes no network changes. Its only outbound call is to the AI2SQL API over HTTPS.
- Can it reach a database inside a private network?
- Yes — run it on any machine that can already reach the database. The database never needs a public address.
- What is stored on my machine?
- Only your AI2SQL sign-in token, in your home directory with owner-only permissions. Database passwords are not written to disk.
Known limitation, stated plainly The Connector currently talks to your database without TLS. For a database on the same machine that changes nothing, but if you point it at a server across your network, schema metadata travels unencrypted on that hop. TLS for the database connection is on the roadmap; the call to AI2SQL is always HTTPS.
The Connector is open source — read the code on GitHub.
Frequently asked
Can AI2SQL connect to a database on localhost? +
Yes, using the AI2SQL Connector. AI2SQL itself runs in the cloud and cannot reach localhost, 127.0.0.1 or a private network address. The Connector is a small application you run on the machine that can already reach the database; it reads the schema there and generates SQL against it.
Can I use a local Microsoft SQL Server database? +
Yes. Choose SQL Server in the Connector and point it at your instance, typically localhost:1433. Load the schema and you can generate T-SQL from plain English against your own tables.
Does my database need to be publicly accessible? +
No. Nothing connects to your database from the internet. The Connector runs on your machine and talks to the database locally, so it never needs a public address.
Do I need port forwarding, a VPN or ngrok? +
No. The Connector opens no inbound ports and requires no firewall or network changes. Removing that setup is precisely why it exists.
What exactly is sent to AI2SQL? +
Your question and the names and data types of the tables you select. No table rows, no credentials and no connection details are sent.
Which databases are supported? +
SQL Server, PostgreSQL and MySQL, with builds for Windows, macOS and Linux.
Can I try it with a test database first? +
Yes, and it is a good way to evaluate it. Point the Connector at a development or sample database with a read-only user and see the SQL it produces before using it against anything that matters.
Do I need a paid AI2SQL plan? +
No. The Connector works with your existing AI2SQL account, and generations count against whatever plan you already have — free plans included, within their monthly limit.
Use AI2SQL with your local database
No tunnels. No firewall changes. Load your schema and start writing SQL in plain English.
⬇ Download Connector