Chapter 3. Accessing MySQL
You have several ways to access an instance of mysqld
(the MySQL server daemon). There are command-line clients and graphical clients for interactively executing SQL commands. Some of these clients can also run files that contain multiple SQL statements for non-interactive use. A database administrator needs to be able to effectively use these tools daily in order to check data integrity, debug application issues, and gather database information to help tune the server.
Graphical User Interface (GUI) tools can perform many of the same functions plus some additional functions such as building ER (Entity Relationship) diagrams.
Accessing mysqld with Command-Line Tools
Most database administrators use command-line client tools for access and for getting information. It is important to understand these tools because you will use them on a daily basis. These tools include mysql
, mysqladmin
, and mysqlshow
.
Though each tool performs different functions, they have several common options. Often these options will have a long form and a short form — for example, to specify a username, you can use the short form -u
or the long form --user
. The most important common tool option is the help option, which is specified with -?
or -I
or --help
. The help option shows a brief summary of the tool, syntax, a list of options and their meanings, and finally ...
Get MySQL® Administrator's Bible now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.