Home >Database >Mysql Tutorial >how to check mysql logs in linux

how to check mysql logs in linux

Jennifer Aniston
Jennifer AnistonOriginal
2024-12-30 15:12:12538browse

How do I view MySQL error logs in Linux?

To view MySQL error logs in Linux, you can use the following steps:

  1. Open a terminal window.
  2. Type the following command:
<code>sudo cat /var/log/mysql/error.log</code>
  1. Press Enter.

The error log will be displayed in the terminal window.

Where can I find MySQL general logs in Linux?

MySQL general logs are stored in the file /var/log/mysql/general.log. You can view the general log by using the following steps:

  1. Open a terminal window.
  2. Type the following command:
<code>sudo cat /var/log/mysql/general.log</code>
  1. Press Enter.

The general log will be displayed in the terminal window.

How can I access MySQL slow query logs in Linux?

MySQL slow query logs are stored in the file /var/log/mysql/slow.log. You can view the slow query log by using the following steps:

  1. Open a terminal window.
  2. Type the following command:
<code>sudo cat /var/log/mysql/slow.log</code>
  1. Press Enter.

The slow query log will be displayed in the terminal window.

The above is the detailed content of how to check mysql logs in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn