mySQL / MariaDB - log level

by
Jeremy Canfield |
Updated: August 14 2023
| mySQL / MariaDB articles
The following command can be used to determine the current log level.
mysql -e "select @@log_warnings"
Something like this should be returned.
+----------------+
| @@log_warnings |
+----------------+
| 2 |
+----------------+
There are a number of log levels.
- 0 = the least logging
- 1 = more logging
- 2 = even more logging
- 3 = verbose logging
- 4 = even more verbose logging
- 9 = the most logging possible
The log level can temporarily be change at runtime like this.
mysql -e "SET GLOBAL log_warnings=9"
Or the log level can permanently be changed in the my.cnf file. If you change the directive in my.cnf, you will need to restart mySQL or MariaDB for this change to take effect.
log_warnings=9
Did you find this article helpful?
If so, consider buying me a coffee over at