Book Image

Mastering MariaDB

By : Federico Razzoli
Book Image

Mastering MariaDB

By: Federico Razzoli

Overview of this book

Table of Contents (19 chapters)
Mastering MariaDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The SQL_ERROR_LOG plugin


While the error log stores the SQL errors, it may be useful to keep such errors in a separate log, which will then be used to debug the applications. This can be done via SQL_ERROR_LOG, a plugin introduced in MariaDB 5.5.

The SQL_ERROR_LOG plugin is not installed by default. To install this, you can run the following SQL statement:

MariaDB [(none)]> INSTALL SONAME 'sql_errlog';
Query OK, 0 rows affected (0.04 sec)

Note

Note that it is not necessary to reinstall the plugin at every server restart.

MySQL users will probably notice that we used a MariaDB extension to the INSTALL statement. This syntax allows installing all plugins contained in the sql_errlog library, not only a specific plugin. In this case, the library contains only one plugin, so the only advantage is that the command is shorter. However, there is another difference: we did not include the file extension (.so or .dll), because it is optional in MariaDB. This makes the command independent from the...