MySQL and MariaDB
Selekta connects to MySQL and MariaDB with one bundled native driver, on port 3306 by default, and keeps the server's own sql_mode and time zone so queries behave as they do on the server. One connection can browse every database the user can see.
Connect
Choose MySQL / MariaDB in the engine list, or paste a mysql:// or mariadb:// URL. Fill in Host, Port (3306), User and Password. Database is optional: leave it empty to start without a default database.
mysql://[email protected]:3306/billing?ssl-mode=VERIFY_IDENTITY
- Authentication: user and password, including accounts that use
caching_sha2_password. For certificate authentication, add a Client certificate and Client key on the SSL tab. - SSL: DISABLED, PREFERRED, REQUIRED, VERIFY_CA and VERIFY_IDENTITY. Remote hosts default to REQUIRED,
localhostto PREFERRED. See SSH tunnels and TLS. - Server detection: the test banner says "MySQL 8.0.39" or "MariaDB 11.4.2", read from the server's version string.
If the server rejects the password, check the host part of the account too: MySQL accounts are tied to the address you connect from.
Navigator
The navigator lists every database the user can see, except mysql, information_schema, performance_schema and sys. Each database has three folders: tables, views and functions. Tables open on columns, indexes, foreign keys and triggers.
Row counts next to tables come from information_schema and are estimates. Selekta asks MySQL 8 for fresh numbers instead of its cached ones.
Session behaviour
Selekta does not change how SQL is interpreted on your server:
- sql_mode: each session uses the server's global
sql_mode. Whether||means OR or string concatenation, for example, follows your server. - Session time zone (Advanced tab): Server default keeps the server's time zone. UTC sets
+00:00. This Mac's zone sets your Mac's current UTC offset, not a named zone, so a session that stays open across a daylight saving change keeps the old offset. - Read-only: each session runs
SET SESSION TRANSACTION READ ONLY, and Selekta blocks writing statements before they are sent. - Cancel (⌘.) sends
KILL QUERYfor the running statement.
Scripts and transactions
Run script (⌥X) splits a script into statements. DELIMITER lines work as they do in the mysql command line tool: they switch the delimiter and are never sent to the server.
DELIMITER //
CREATE PROCEDURE archive_orders()
BEGIN
INSERT INTO orders_archive SELECT * FROM orders WHERE status = 'closed';
DELETE FROM orders WHERE status = 'closed';
END //
DELIMITER ;
CREATE PROCEDURE, FUNCTION, TRIGGER and EVENT bodies written between BEGIN and END also stay one statement without a DELIMITER line.
In manual commit mode, MySQL commits the open transaction by itself before statements such as CREATE, ALTER, DROP or BEGIN. When you still have pending statements, Selekta stops before such a statement and asks you to commit or roll back first, so nothing is committed behind your back. See Production safety.
Explain and spatial data
Explain (⌘E) runs EXPLAIN FORMAT=JSON and draws the plan as a tree. Explain Analyze (⌥⌘E) runs EXPLAIN ANALYZE, which executes the statement and reports actual times, so confirmations for destructive statements still apply. See Explain plans.
On Production and Staging connections, a DELETE or UPDATE with a WHERE clause first gets a row estimate from EXPLAIN, which decides whether it needs confirmation.
Spatial columns (GEOMETRY, POINT, POLYGON and the rest) are decoded with their SRID and can be shown on the map panel.
Backup and limits
Backup… and Restore… use mysqldump and mysql, or mariadb-dump and mariadb, found on your Mac. They are not bundled. See Backup and restore.
Not supported today:
- Connecting through a Unix socket file. Use
127.0.0.1and the TCP port instead. - Stored procedures in the navigator. They run with
CALL, but only functions are listed.