Opens a direct SQL session from Visual Studio Code to a MariaDB server so you can write, run, and debug queries inside the editor.
Running queries inside VS Code removes context-switching, lets you save scripts in Git, and enables Galaxy AI copilot to refactor SQL instantly.
Install SQLTools plus the SQLTools MariaDB/MySQL Driver. Both are free in the Marketplace and support connection pooling, snippets, and result grids.
Open the Extensions panel ⇧⌘X, search for “SQLTools”, click Install, then repeat for “SQLTools MariaDB/MySQL”. Reload VS Code when prompted.
Press ⌘P → type SQLTools: Add New Connection
→ choose MariaDB/MySQL. Fill in host, port, user, password, and default database. Save to settings.json
so it syncs with source control.
Use the URI shown below or individual fields in the wizard.
mariadb://shop_admin:Secr3t@db.example.com:3306/shop?ssl=true&connectionTimeout=10000
Open a .sql
file, select a connection from the Status Bar, write your query, and hit ⌘-Enter. Results appear in the Results View and can be exported as CSV.
Store secrets in .env
and reference them with VS Code variables, enable ssl=true
for production, and commit the settings.json
minus passwords.
"ER_ACCESS_DENIED_ERROR" means wrong credentials—double-check the user has SELECT
on the target schema. "Handshake inactivity timeout" indicates a blocked port; ensure 3306 is open.
Yes. SQLTools saves each connection as a separate object in settings.json
. Switch between them from the Status Bar.
Absolutely. With the connection active, Galaxy suggests context-aware completions, refactors queries, and explains execution plans.
Select the text you want to execute and press ⌘-Enter; SQLTools sends only the highlighted portion to MariaDB.