Workbench and the CLI
You can talk to MySQL in two friendly ways.
The CLI is the mysql program in a terminal.
MySQL Workbench is a window with buttons, diagrams, and a SQL editor.
The command line
The CLI is fast and works on servers with no mouse.
You type SQL, press Enter, and see a text table.
| Database |
|---|
| information_schema |
| fox_school |
| mysql |
3 rows
Database changed
| Tables_in_fox_school |
|---|
| scores |
| students |
2 rows
Workbench
Workbench lets you click a database, browse rows, and run SQL.
It is nice when you are learning, because you can see tables as grids.
SQL editor for long scripts
Result grid like a spreadsheet
Visual models of tables
Saved connections
A good habit
Write SQL in the editor. Run it. Read the result.
Save useful scripts as .sql files.
Do not click around blindly. SQL you can read is SQL you can fix.
| DATABASE() |
|---|
| fox_school |
1 row
| USER() |
|---|
| root@localhost |
1 row
Tip: Either tool is fine. Learn the SQL. The window is just a mailbox.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.