You can answer many questions about a MySQL server by inspecting its
status. MySQL exposes information about server internals in two main ways:
the newest is the standard
INFORMATION_SCHEMA database, and the more
traditional is a series of
commands (which MySQL continues to support even though the
INFORMATION_SCHEMA database is the preferred
mechanism for new features). Some information you can get via
SHOW commands isn’t found in the
INFORMATION_SCHEMA tables yet.
The challenges for you are determining what is relevant to your problem, how to get the information you need, and how to interpret it. Although MySQL lets you see a lot of information about what’s going on inside the server, it’s not always easy to use that information. Understanding it requires patience, experience, and ready access to the MySQL manual.
There are some tools that can help you understand the server status in various contexts, such as monitoring and profiling, and we mention a few of those in the next chapter. However, you should still understand the values at a high level—at a minimum, what the categories of values are—and know how to get them from the server.
This chapter explains many of the status commands and their output. When we’ve covered a topic in detail elsewhere, we refer you to that part of the book.
MySQL exposes many system variables through the
VARIABLES SQL command, as variables you can use in
expressions, or with mysqladmin variables ...