Use mysql CLI or GUI clients to open a secure session to a MariaDB server for running SQL.
Use the mysql
command-line client for scripts and quick checks, or a GUI like DBeaver, TablePlus, or Galaxy SQL Editor for visual work.
Run mysql -u user -p -h host -P port dbname
. When prompted, supply the password.Use --ssl-mode=REQUIRED
in production.
mysql -u shop_admin -p -h 192.168.1.10 -P 3306 ecommerce
Create a ~/.my.cnf
file with [client]
section containing your credentials. Set file permission to 600
; then run mysql ecommerce
with no password prompt.
Create the tunnel: ssh -L 3307:db.internal:3306 user@bastion
.Keep the terminal open, then connect locally with mysql -u shop_admin -p -h 127.0.0.1 -P 3307 ecommerce
.
DBeaver, TablePlus, and Galaxy provide native MariaDB drivers, SSL options, and query history. Configure host, port, user, password, database, and optionally SSH tunnel details.
Choose “Add Connection → MariaDB”, fill the host, port, user, and database, enable SSL if needed, and click “Test & Save”.Double-click the connection to start querying.
After connecting, execute SELECT COUNT(*) AS total_orders FROM Orders;
to verify access and row counts.
CLI: add --reconnect
(older versions) or handle exit codes in a shell loop. GUI clients usually reconnect automatically; enable “auto-reconnect” in settings.
Inside mysql>
, type USE analytics;
.In GUIs, pick a different schema from the sidebar.
Always require SSL, use least-privileged users, rotate passwords, and restrict host firewall rules. Store credentials in vaults or ~/.my.cnf
with correct permissions.
Developers connect to fetch daily revenue, debug failed orders, or update product stock levels. Automated scripts use CLI with option files for nightly reports.
.
No. psql
is the PostgreSQL client. Use mysql
or a MariaDB-aware GUI instead.
Your user lacks the correct host wildcard in the GRANT statement. Run GRANT ALL ON ecommerce.* TO 'shop_admin'@'10.%' IDENTIFIED BY '***';
After connecting, run \s
in the mysql
shell and look for “SSL: Cipher in use”. GUI clients show SSL status in the connection info pane.