How to see mysql error logs?

shenkwen

Sorry if this is a wrong place to ask.

I use Ubuntu 16.04, with very little knowledge of linux system, I depend on webmin to host my website. Recently there has been a problem where mysql won't start, so I am trying to look into the error logs to get a clue about what is wrong.

My first question is: What is the general way to find where the error log is? I've done a lot of search but it seems to me in different system, and with different setting, these error logs could be in different places, and the filename is also different. Although I've managed to find them under /var/log/mysql/ (which is different from every source I was able to find), I'd like to know how to find these logs' location in general. I think there should be some configuration file in control of this, right? Besides, on some webpage a mysql.log file is mentioned, but I can't find where it is.

Secondly, under /var/log/mysql, there are files like error.log and error.log.1.gz, error.log.2.gz. Except the error.log file, in order to read other files I have to extract them first. Is there any way, like some mysql command , to read them directly?

Rinzwind

Although I've managed to find them under /var/log/mysql/ (which is different from every source I was able to find),

Logfiles have been stored under /var/log/ for a long time now. It was changed to that location so they are added to "logrotate" by default. You can expect any log file in Ubuntu in /var/log/.

Secondly, under /var/log/mysql, there are files like error.log and error.log.1.gz error.log.2.gz.

The logs with numbers are older logs. Log files get compressed at some point by "logrotate". The settings for when it gets compressed are stored in /etc/logrotate.conf and by default files are compressed "weekly".

Except the error.log file, in order to read other files I have to extract them first. Is there any way, like some mysql command , to read them directly?

No you can't. And no that 1st part is not correct. 2 reasons:

  • The files ending in gz are at least a week old why would you need to see them? A week old errors are too old to be of any use.
  • You can view log files that are compressed.

    zcat /var/log/mysql/error.1.gz | more
    

    will show the lines of the file without uncompressing them.


And to add: log viewer also shows compressed log files. ALl you need to do is add the log file to the viewer (see "open" in the settings):

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

heroku - how to see all the logs

From Dev

Error: GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information. How do I fix this?

From Dev

Ubuntu SDK: How can I see error logs for my ubuntu touch app?

From Dev

Ubuntu SDK: How can I see error logs for my ubuntu touch app?

From Java

How to see logs from npm installation?

From Dev

How to see smtp server logs from cpanel

From Dev

How do I see the iptables logs in systemd

From Dev

How to see smtp server logs from cpanel

From Dev

How can I see previous logs with systemd?

From Dev

MySQL Workbench Export Completed with 1 Errors - how to see error?

From Dev

Email notification on any Error in MySQL error logs

From Dev

How can I see my debug logs on Unity Android?

From Dev

How can I see AWS Gateway logs for external calls?

From Dev

How can I see unavailable servers in Nginx logs?

From Dev

How to see logs when deploying to Heroku from Github?

From Dev

How do I see the logs for the Xwayland server started by Gnome?

From Dev

How to see logs from the back-end of /sys

From Dev

How to see logs between right before midnight to right after?

From Dev

how to see logs like the Log.info("something") in test kitchen?

From Dev

How can I see system logs while booting up ubuntu?

From Dev

Incremental backup with rollforward logs: How to get the logs with MySQL commands?

From Dev

How to send error logs on email in Scrapy

From Dev

How to put custom variables into PHP error logs

From Dev

Error:Execution failed for task ':ProjectName:mergeDebugResources'. > Crunching Cruncher *some file* failed, see logs

From Dev

Can't load any PHP file or see any error in the logs using nginx and php7

From Dev

The server encountered an error processing the request. See server logs for more details

From Dev

Unexpected error during Oracle Service Bus synchronization. Please see the logs for more information.

From Dev

Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details build gradle issues

From Dev

Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details build gradle issues

Related Related

  1. 1

    heroku - how to see all the logs

  2. 2

    Error: GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information. How do I fix this?

  3. 3

    Ubuntu SDK: How can I see error logs for my ubuntu touch app?

  4. 4

    Ubuntu SDK: How can I see error logs for my ubuntu touch app?

  5. 5

    How to see logs from npm installation?

  6. 6

    How to see smtp server logs from cpanel

  7. 7

    How do I see the iptables logs in systemd

  8. 8

    How to see smtp server logs from cpanel

  9. 9

    How can I see previous logs with systemd?

  10. 10

    MySQL Workbench Export Completed with 1 Errors - how to see error?

  11. 11

    Email notification on any Error in MySQL error logs

  12. 12

    How can I see my debug logs on Unity Android?

  13. 13

    How can I see AWS Gateway logs for external calls?

  14. 14

    How can I see unavailable servers in Nginx logs?

  15. 15

    How to see logs when deploying to Heroku from Github?

  16. 16

    How do I see the logs for the Xwayland server started by Gnome?

  17. 17

    How to see logs from the back-end of /sys

  18. 18

    How to see logs between right before midnight to right after?

  19. 19

    how to see logs like the Log.info("something") in test kitchen?

  20. 20

    How can I see system logs while booting up ubuntu?

  21. 21

    Incremental backup with rollforward logs: How to get the logs with MySQL commands?

  22. 22

    How to send error logs on email in Scrapy

  23. 23

    How to put custom variables into PHP error logs

  24. 24

    Error:Execution failed for task ':ProjectName:mergeDebugResources'. > Crunching Cruncher *some file* failed, see logs

  25. 25

    Can't load any PHP file or see any error in the logs using nginx and php7

  26. 26

    The server encountered an error processing the request. See server logs for more details

  27. 27

    Unexpected error during Oracle Service Bus synchronization. Please see the logs for more information.

  28. 28

    Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details build gradle issues

  29. 29

    Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details build gradle issues

HotTag

Archive