Databases6 min read

How to Query SQL Databases from Your Desktop: Connect PostgreSQL, MySQL, MariaDB

Connect to PostgreSQL, MySQL, or MariaDB from your desktop with the built-in SQL client in MyDevTools. Run SQL queries, explore schemas, and export results without a separate database app. All credentials are AES-256 encrypted locally.

Get the tool mentioned in this guide in the desktop app:SQL Client

Why use the SQL client in an all-in-one desktop toolkit?

Single-purpose database clients like DBeaver, TablePlus, and pgAdmin connect to your database, but each is a separate app to install and manage. A SQL client bundled into an all-in-one desktop toolkit lives alongside your other developer tools: open MyDevTools, enter your connection details, and start querying—no extra app, no cloud round-trip.

The SQL Client in MyDevTools runs locally on your desktop, encrypts your credentials with AES-256 before storing them, and keeps your connection details on your machine. You can run SELECT, INSERT, UPDATE, DELETE, and administrative queries directly against PostgreSQL, MySQL, and MariaDB instances.

How to connect to your database

You need four pieces of information:

  • Host — Domain or IP of the database server (e.g., db.example.com or localhost:5432).
  • Port — Default ports: PostgreSQL 5432, MySQL/MariaDB 3306.
  • Username — Your database user.
  • Password — Your user password.

Optionally provide a database name to start in a specific database context. Enter these details into the SQL Client, and it will attempt a connection. If successful, you can immediately start writing queries.

text
-- PostgreSQL connection example
Host: postgres.railway.app
Port: 5432
User: postgres
Password: ••••••••

-- MySQL connection example
Host: localhost
Port: 3306
User: root
Password: ••••••••

Running queries and exploring schemas

Once connected, write any SQL query. The interface shows results in a table, with column headers, data types, and row counts. For larger result sets, pagination prevents the app from loading millions of rows at once.

On the left sidebar, you can browse your database structure: list tables, columns, and their types. This schema explorer saves you from memorizing table names and column definitions.

sql
-- List all tables
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public';

-- Count rows in a table
SELECT COUNT(*) FROM users;

-- Query with conditions
SELECT id, email, created_at FROM users
WHERE created_at > NOW() - INTERVAL '7 days'
ORDER BY created_at DESC;

Exporting results and managing connections

Results can be exported to CSV for further analysis in spreadsheet tools. Multiple database connections can be saved securely—your credentials are encrypted with AES-256 in local storage on your machine before any sync, so the server never sees plaintext passwords.

Use the saved connections to quickly switch between development, staging, and production databases (with appropriate caution and role-based permissions on your database users).

Security: credentials and encrypted storage

Your database credentials are sensitive. The MyDevTools SQL Client encrypts them with AES-256 on your desktop before storing locally, so plaintext passwords never leave your machine. For production databases, follow your organization's credential policies: use temporary tokens, short-lived credentials, or SSH tunneling if available.

Frequently asked questions

Is it safe to paste my database password into a SQL client?

Use a client that encrypts credentials locally before storage. The MyDevTools SQL Client is a desktop app that uses AES-256 encryption on your machine, so passwords never reach a server unencrypted. Avoid clients that send credentials over unencrypted connections.

Can I use SQL Client to manage production databases?

Yes, but follow your organization security policy. Use read-only credentials for production or temporary tokens with expiration. Never save production passwords in a shared tool.

Does SQL Client support PostgreSQL, MySQL, and MariaDB?

Yes, all three are supported. MariaDB is MySQL-compatible, so the same connection method works.

Can I run administrative commands like CREATE TABLE or DROP?

Yes, any SQL query that your user role permits. Make sure your user permissions match your intent (e.g., read-only for exploration, write access only for development).

Get SQL Client in the desktop app

Connect to PostgreSQL, MySQL, and MariaDB databases from your desktop. Run queries, explore schemas, and export results. Credentials encrypted with AES-256 before storage. Runs fully offline in the MyDevTools desktop app.