You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to clear MySQL logs (transaction log or log table)

Practice



How do you clear the logs in MySQL?


Method 1 - if MySQL is still alive:

Log in to the MySQL server console and run these commands:

> truncate mysql.general_log;
> truncate mysql.slow_log;



Method 2 - works even if MySQL has already died or run out of disk space:

Simply delete the general_log.* and slow_log.* files from the mysql directory inside the folder where all the DBMS server's databases are stored.

Relevant for: MySQL 5.x

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Databases - MySql (Maria DB)"

Terms: Databases - MySql (Maria DB)