MySQL Workbench and the Command Line

Site Admin · 11 Sep 2026 · 2 views

Two Ways to Talk to MySQL

You can interact with MySQL using a graphical tool, MySQL Workbench, or the text-based command line client. Both connect to the same server and execute the same SQL.

MySQL Workbench

Workbench bundles three useful tools:

  • SQL editor: write queries, run them and see results in a grid.
  • Data modeling: design tables visually and forward-engineer them to the server.
  • Administration: manage users, backups, logs and server settings.

The mysql Command-Line Client

mysql -u root -p tutorial_site

SHOW DATABASES;
USE tutorial_site;
SHOW TABLES;
DESCRIBE users;
  • SHOW DATABASES; lists every database on the server.
  • USE dbname; selects the active database.
  • SHOW TABLES; lists tables in the active database.
  • DESCRIBE table; (or DESC) shows the columns of a table.

Useful Client Commands

SHOW ENGINES;
SELECT VERSION();
SELECT DATABASE();
STATUS;

Commands starting with a backslash are client commands, for example \G turns results vertical, and source file.sql runs a SQL script.

Key Points

  • Workbench is GUI; the mysql client is terminal-based.
  • Use SHOW DATABASES, USE, DESCRIBE to explore.
  • Run script files with source filename.sql.
  • All queries end with a semicolon.
Share this post:

Comments (0)

Please login or register to comment.