MySQL Logs … where are they?

I may be blind or lame – but I cannot find where the MySQL logs are, at least in the web interface for virtualmin or webmin. Is it really the case that you can’t see that through the web admin?

Or should I be expecting to find them elsewhere?

Specifically, I’m trying to figure out why I cannot connect to certain databases – and rather than troubleshoot, I wanted to start with the logs to see if they gave me insight.
Thanks!

Neil

By default, MySQL doesn’t produce logs (though you’ll find info about startup errors in either /var/log/messages or the journal if you have a systemd-based system).

https://dev.mysql.com/doc/refman/5.7/en/server-logs.html

Webmin has a System Logs module that can view and search any log on the system, so if you enable MySQL logs, you’ll be able to view them in Webmin. You can find that under Webmin->System->System Logs.

Oh, actually, on CentOS you’ll have a log in /var/log/mariadb or /var/log/mysql. Which you can view with the System Logs module (or the File Manager).

Looks like to get this going, I need to … at the command line (Ubuntu 14.04LTS for us) … turn on mysql logs, and then I’ll be able to see them at Webmin->System->System Logs ?

Or is there a way to turn on the logs via the virtualmin/webmin interface?

I don’t have an Ubuntu system in front of me. But, I’d bet there is at least a basic error log in /var/log/mysql. So, check there.

You can view any log by browsing to Webmin->System->System Logs and choosing it in the “View log file:” field. (You can open a file chooser with the button to the right of it.)

If you need the log to always show up in the list, you can add it; it’s not super intuitive how to add a log without actually setting up syslog to put things in the log (System Logs module is a syslog–or rsyslog, or syslog-ng–management module, but can also act as a simple log viewer). Click “Add a new system log”, fill in the path to your MySQL log (again, that’s in /var/log/mariadb or /var/log/mysql, almost certainly, but you might need to poke around some), choose “No” for Active (because you don’t want syslog to add anything to this log), and choose whatever you want in the Facilities field–it doesn’t matter what’s in that field, but it’ll make you choose something in order to save it).

As I mentioned above, you can also use the File Manager to view any file on the system, including log files. It may ever be the nicer way to do it. You could book mark the directory it is in, and be able to browse to it rapidly when you need it.