SQLLens.AI Docs
Guides

Connect a database

Add a MySQL or MariaDB connection when you’re ready to run SQL from the editor—basics, advanced options, SSL, and SSH tunnels.

Animated demo: Connect to MySQL — saved profiles and test connection.
Connection flow — profiles, host, credentials, and Test Connection.
Animated demo: explorer and SQL workspace after connecting.
After connect — active database, tree, and SQL editor.

Open the connection dialog

Open the SQLLens.AI sidebar and choose + Add connection (or edit an existing entry). The Connect to MySQL Host window opens with four tabs: MySQL, SSH, SSL, and Advanced.

Saved connections & toolbar

Use the top of the dialog to pick or manage profiles before you connect.

ControlWhat it does
Saved ConnectionsDropdown of saved profiles (for example 127.0.0.1:3306). Select one to load its settings. Unsaved work may appear as an italic entry until you save.
NewStart a blank profile; you are prompted for a connection name.
CloneCopy the current saved profile under a new name (available when editing a saved connection).
SaveWrite changes to the profile (enabled when the form has unsaved edits and a name is set).
RenameChange the display name of the saved profile.
DeleteRemove the saved profile after confirmation.

After a successful save you may see Connection Auto saved. Status banners above the tabs report test or connect failures and successes.

MySQL tab

Core server login and optional URL helpers. Required fields are marked in the UI.

FieldWhat it isTypical value
MySQL Host AddressHostname or IP of the MySQL/MariaDB server127.0.0.1
UsernameDatabase userroot
PasswordAccount password—
Save PasswordWhen checked, stores the password in VS Code Secret Storage (not in settings.json)On
PortTCP port3306
Database(s)Optional default schema(s). Use ; to list several; leave blank to show all databases you can accessapp or empty
Connection URLOptional mysql:// URL; can be parsed into the fields abovemysql://user@host:3306/db
Paste URL / Build URLPaste a URL from the clipboard into the form, or build a URL from the current host, port, user, password, and database fields—
Use Compressed ProtocolEnables compressed client protocol when the server supports itOff unless needed
Session Idle TimeoutDefault uses server settings, or Custom with a value in secondsDefault
Keep-Alive IntervalHow often (seconds) the client sends keep-alive traffic on idle connections28800
Connect to MySQL Host dialog showing saved connection, host, username, password, port, and database fields.
MySQL tab — host, user, password (with Save Password), port, database(s), and Connection URL with Paste URL / Build URL.

SSH tab

Use this when MySQL is only reachable through a bastion or jump host. Enable Use SSH Tunnel, then complete the SSH fields below.

FieldWhat it isTypical value
Use SSH TunnelTurns SSH port forwarding on for this profileOff unless required
SSH HostBastion hostname or IP (required when tunnel is on)bastion.example.com
SSH PortSSH daemon port22
SSH UsernameSSH login userroot
Authentication MethodPassword or Private KeyPassword
SSH PasswordShown when method is Password (required)—
Private Key PathPath to key file when method is Private Key; use Browse… to pick a file~/.ssh/id_rsa
PassphraseOptional unlock phrase for an encrypted private key—

SQLLens.AI opens a local forward through SSH, then connects the MySQL client to the database host and port from the MySQL tab.

Connect to MySQL Host dialog on the SSH tab with Use SSH Tunnel enabled, host, port, username, and authentication method fields.
SSH tab — Use SSH Tunnel, host, port, username, and authentication method (password or private key).

SSL tab

Enable Use SSL/TLS when the server requires encrypted connections. Optional certificate paths map to standard MySQL SSL file options.

FieldWhat it is
Use SSL/TLSTurns TLS on for this profile
CA CertificatePath to the certificate authority file (.pem)
Client CertificatePath to the client certificate file
Client KeyPath to the client private key file
Heads up

Use CA and client cert/key paths that match your server’s TLS policy. For internal labs only, your administrator may allow simpler trust settings on the server side—do not relax TLS requirements on production systems without approval.

Advanced tab

Fine-tune timeouts, locale, and which databases appear in the explorer tree.

FieldWhat it isTypical value
Connection TimeoutSeconds to wait while opening the TCP/MySQL session30
Request TimeoutSeconds to wait for an individual request to finish30
TimezoneSession timezone offset sent to the server+00:00
Character EncodingClient character set (UTF-8, UTF-8 MB4, Latin1, ASCII)UTF-8
Show Hidden DatabasesWhen checked, includes system/hidden schemas in the tree if the server exposes themOff
Include DatabasesComma-separated allow list; only these databases appear in the explorer (empty = no filter)empty

Connect, test, or cancel

At the bottom of the dialog: