Summary

This chapter focused on logging, finding, and understanding the errors that occur in a MariaDB installation.

We analyzed the information available in a single error condition. These conditions populate the diagnostics area. We discussed how the diagnostics area is populated or emptied by the statements we execute. We also discussed and tried the SQL statements that show information from the diagnostics area: SHOW WARNINGS, SHOW ERRORS, and GET DIAGNOSTICS. The SQL errors are also logged in a file if the SQL_ERROR_LOG plugin is enabled. We learned how to use that plugin efficiently. Some further notes were dedicated to the debugging of stored programs, which is often a difficult task.

The general query log is also useful to debug applications or find problematic statements. While it does not contain information about errors which occurred, it keeps a track of all the statements that were sent to the server. This log can be written to a file or to a SQL table called general_log.

SQL errors are not the only type of errors that can occur. The error log contains other types of errors, including the ones that prevent the server from starting, or a plugin from loading, or the data corruption problems. This log is always written to a file.

We also discussed the format of both the error log and the general query log. We discussed some simple examples, where we used the Linux command line to find the log entries we needed. We also learned how to rotate the logs, and to prevent individual files from growing too much.

We did not analyze all MariaDB logs, still. However, with this information, we have the necessary knowledge to find the problems that may occur while using the advanced MariaDB techniques that are discussed in the following chapters.

In the next chapter, we will learn how to use the slow query log to find slow SQL statements, and how to optimize queries to make them faster.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.19.185