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

how to check mysql logs in linux

Jennifer Aniston
Release: 2024-12-30 15:12:12
Original
506 people have browsed it

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>
Copy after login
  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>
Copy after login
  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>
Copy after login
  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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template