How delete large file server.log?

Joso

Member
Sep 21, 2021
7
2
3
Italy
cPanel Access Level
Website Owner
Hi, on the VPS with cPanel the space has been reduced to the point that on an 800 gb SSD there are only about 100 gb left, so it is occupied for about 87%.

Analyzing the various files and folders I noticed that in the /var/lib/mysql folder there is the server.log file which occupies about 600gb.

I would like to know if I can delete this file and how to prevent it from being recreated so big.

Thank you
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,163
2,410
363
cPanel Access Level
Root Administrator
@Joso - that is likely the main error log file for the MySQL service. You can check and confirm this with the following command:

Code:
grep log-error /etc/my.cnf
which will show you the current error log location for MySQL.

The best solution would be to examine the log and determine why there are so many errors being created, as this would indicate major issues with a user account or MySQL tool. Just deleting the log file or emptying it will not resolve the issue.