30GB log file
Dear, there is a log file in that directory that is 30GB, is there a problem deleting or cleaning it to reduce disk space?
/var/lib/mysql/server.log
-
Hey there! This is likely the main log for the MySQL server. You could confirm this by running this command to see the log file location: grep " /var/lib/mysql/server.log" /etc/my.cnf I would check and see how long the log has existed with this command: head /var/lib/mysql/server.log as that would tell you how quickly it is growing to that size. If it is growing quickly to that size it would be a good idea to find out what is creating so much log data. If it's been in existence for years, it would be fine to empty the log file. You wouldn't want to delete it as the system will expect to see that there, but a quick echo statement would clear it out: echo "" /var/lib/mysql/server.log 0 -
grep " /var/lib/mysql/server.log" /etc/my.cnf this command returns empty head /var/lib/mysql/server.log this command returns Tcp port: 0 Unix socket: (null) Time Id Command Argument 230601 9:25:37 3 Connect root@localhost on using Socket 4 Connect antonina_loja@localhost on antonina_loja using Socket 5 Connect eletro_novo@localhost on eletro_novo using Socket 3 Query SET autocommit=0 3 Query SHOW FULL PROCESSLIST 3 Quit 4 Query SET NAMES utf8 echo "" /var/lib/mysql/server.log this one didn't change the file size I tried this command too echo -n > server.log this one didn't change the file size
0 -
Whoops, I missed part of that echo command - this will work: echo "" > /var/lib/mysql/server.log 0 -
I cleaned the file but it has constant records of access to the database, which show connections, tables, ips I will continue monitoring because it grows every min 20mb 0 -
this file is powered by SQL settings 0 -
I disabled the log and it stopped recording information, problem solved, thanks for the support 0 -
I'm glad that's all it was - having the general query log enabled should only be done for short times during troubleshooting, as you can see it will quickly fill the space as it logs every MySQL transaction. 0
Please sign in to leave a comment.
Comments
8 comments