Database Reference
In-Depth Information
■
Commands are typed after the
MariaDB >
prompt.
(MariaDB >
indicates that you are connected to a MariaDB server, the prompt
would be
MySQL >
if you were connected to a MySQL server.)
■
Commands end with
;
or
\g
; in other words, just pressing Enter will
not execute the command.
■
You can use the up and down arrow keys to scroll through previously
entered commands.
■
You can type
help
or
\h
to obtain help. You can also provide addi-
tional text to obtain help on specific commands (for example,
help
select
to obtain help on using the
SELECT
statement).
■
You can type
quit
or
exit
to quit the command line utility.
Note
Execute Saved Scripts You can use
mysql
to execute saved scripts—the scripts
used to create and populate the tables used throughout this topic, for example. To
do this, enter
\. filename
(specifying the full path to the file) and press Enter.
Appendix B, “The Example Tables,” walks you through this process for the chapters in
this topic.
The
mysql
command line utility is one of the most used, and is invaluable for
quick testing and executing scripts (such as the sample table creation and popu-
lation scripts mentioned in the previous chapter and in Appendix B). In fact, all
the output examples used in this topic are captured from
mysql
command
line output.
Tip
Familiarize Yourself with the
mysql
Command Line Even if you opt to use a graphi-
cal tool like the one described next, you should make sure to familiarize yourself with
the
mysql
command line utility, as this is the one client you can safely rely on to
always be present (as it is part of the core MariaDB installation).
MySQL Workbench
is a graphical interactive client designed to simplify the
administration of MySQL servers. And, as you'd expect, it works really well
with MariaDB, as well.