Chapter 13. MySQL Server Status

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 SHOW 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.

System Variables

MySQL exposes many system variables through the SHOW VARIABLES SQL command, as variables you can use in expressions, or with mysqladmin variables ...

Get High Performance MySQL, 2nd Edition 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.