A MySQL client is the tool you use to connect to a database server, inspect table schemas, and execute SQL queries. You can work in the built-in mysql terminal client or pick a visual desktop editor like MySQL Workbench, DBeaver, or TablePlus.
Different tasks suit different editors. Terminal tools shine during SSH debugging and automated deploys, while GUI tools make schema browsing and CSV exports quick.
| Client Tool | Best Use Case | Platform Support |
|---|---|---|
mysql CLI |
Server SSH sessions, scripting, quick checks | Linux, macOS, Windows |
| MySQL Workbench | Visual ER diagrams, admin dashboards | Windows, macOS, Linux |
| DBeaver | Multi-database querying and data exports | Windows, macOS, Linux |
| TablePlus | Fast native table editing and query tabs | macOS, Windows, Linux |
mysql Terminal CommandsConnect to a local or remote server from your shell by passing host, port, user, and database name:
mysql -h 127.0.0.1 -P 3306 -u app_user -p demo_store
Once inside the interactive prompt, use these inspection commands to explore tables without guessing column names:
-- List all tables in the current database
SHOW TABLES;
-- Print column names, types, and keys for demo_orders
DESCRIBE demo_orders;
-- Print the exact CREATE TABLE DDL statement
SHOW CREATE TABLE demo_orders\G
-- Inspect query index usage vertically
EXPLAIN SELECT id, total_amount FROM demo_orders WHERE customer_id = 42\G
\G for Wide Output: Ending a CLI query with \G instead of ; prints each column on its own line so wide EXPLAIN rows stay readable.UPDATE or DELETE calls without a WHERE key are blocked.DBeaver Community and MySQL Workbench are both free and provide visual table editors, query autocomplete, and clear error messages.
.sql file from the terminal?Pass the file with shell redirection, such as mysql -u app_user -p demo_store < schema.sql, to execute every statement inside it.
\G do in the MySQL command-line client?It replaces the semicolon terminator and displays result rows vertically, which makes long SHOW CREATE TABLE output easy to read.
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With
Experiment with the code from this lesson in our interactive playground.