Skip to content

MySQL / MariaDB

SoftDB supports both MySQL and MariaDB through the same driver. You get multi-database browsing, full table and column introspection, TLS configuration, a structure designer, and transaction support.

  1. Open the Connection Hub and click New Connection.

  2. Select MySQL or MariaDB as the database type.

  3. Fill in your connection details:

    • Host: localhost
    • Port: 3306
    • Username: root (or your user)
    • Password: your password
    • Database: leave blank to browse all databases, or enter a specific database name
  4. Click Test Connection, then Save.

  5. Open the connection. The sidebar shows your databases, tables, views, and functions.

FieldDefaultNotes
HostlocalhostHostname or IP of the MySQL/MariaDB server
Port3306Standard MySQL/MariaDB port
UsernameRequired
PasswordStored encrypted
DatabaseOptional. Leave blank to enable multi-DB browsing
SSL ModedisableSee TLS modes below
ModeDescription
disableNo TLS. Default for local development.
requireRequire TLS, skip certificate verification.
verify-caRequire TLS and verify the server certificate against a CA.
verify-fullRequire TLS, verify the CA, and verify the hostname.

When you leave the Database field blank, SoftDB runs SHOW DATABASES and filters out system databases (information_schema, performance_schema, mysql, sys). The sidebar shows a three-level tree:

Connection
└── my_app
├── users
├── orders
└── products
└── analytics
└── events

Unlike PostgreSQL, MySQL doesn’t require a reconnect to switch databases. SoftDB issues a USE <database> statement to switch context, so browsing across databases is fast.

If you specify a database name in the connection settings, only that database appears in the tree.

The structure designer supports creating and modifying tables visually. Supported operations:

OperationSupportedNotes
Create tableYes
Add columnYes
Rename columnYesRequires a modern MySQL or MariaDB server
Change column typeYesRequires confirmation — rebuilds the full column definition
Change column defaultYes
Change column nullabilityYesRebuilds the full column definition
Drop columnYesDestructive, requires confirmation
SELECT
u.id,
u.name,
COUNT(o.id) AS order_count,
SUM(o.total) AS total_spent
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
GROUP BY u.id, u.name
ORDER BY total_spent DESC
LIMIT 20;
-- Find users who have placed more orders than average
SELECT id, name
FROM users
WHERE id IN (
SELECT user_id
FROM orders
GROUP BY user_id
HAVING COUNT(*) > (SELECT AVG(cnt) FROM (SELECT COUNT(*) AS cnt FROM orders GROUP BY user_id) t)
);
-- Products with more than 100 sales in the last 30 days
SELECT
p.name,
SUM(oi.quantity) AS units_sold
FROM order_items oi
JOIN products p ON p.id = oi.product_id
JOIN orders o ON o.id = oi.order_id
WHERE o.created_at >= NOW() - INTERVAL 30 DAY
GROUP BY p.id, p.name
HAVING units_sold > 100
ORDER BY units_sold DESC;
-- Inspect table structure
DESCRIBE users;
-- Show indexes on a table
SHOW INDEX FROM orders;
-- Show current database
SELECT DATABASE();

MySQL and MariaDB support explicit transactions for DML statements:

START TRANSACTION;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;
failed to ping mysql: dial tcp 127.0.0.1:3306: connect: connection refused

MySQL/MariaDB isn’t running, or it’s listening on a different port. Check the service status with systemctl status mysql or systemctl status mariadb. Verify the port in /etc/mysql/my.cnf or /etc/my.cnf.

failed to ping mysql: Error 1045 (28000): Access denied for user 'root'@'localhost'

Wrong username or password. If you’re connecting from a remote host, the user may not have remote access. Grant it with:

CREATE USER 'myuser'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%';
FLUSH PRIVILEGES;
failed to ping mysql: x509: certificate signed by unknown authority

The server requires TLS but the certificate can’t be verified. Try require mode first (skips verification). If you need full verification, ensure the CA certificate is trusted on your system.