MYSQL general query log file

preview_player
Показать описание
How to check and update General Query Log File in Linux:
********************************************************
The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or
disconnect, and it logs each SQL statement received from clients.
The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.

mysql -u root -p

show variables like '%general%';
mysql show variables like '%general%';
+------------------+---------------------------+
| Variable_name | Value |
+------------------+---------------------------+
| general_log | OFF |
+------------------+---------------------------+
2 rows in set (0.05 sec)

Steps to turn on General Query log file for MySQL
*************************************************
1. service mysqld stop

general_log=1

Note : The default location for General Query log file for MySQL installed on Linux is /var/lib/MySQL.

3. Once you modify start the MySQL service.
service mysqld stop

mysql -u root -p

show variables like '%general%';

create database test;
drop database test;

Monitor as below
Рекомендации по теме
Комментарии
Автор

Thanks mate, very informative. I’m still learning the ropes in IT, was always curious what logs are, your video really helped. Much appreciated, wishing you the best!

mcraj
Автор

Hey can you tell me how check logs using query, because I m not using any instance I am using heildisql

nishitkumar
Автор

do you replay to comments as I have a question?

ravon