Skip to main content
We are currently experiencing a higher than average ticket volume and as such our responses may be delayed. Searching on our Help Center articles or going to our Community is also a great resource for answers.

30GB log file

Comments

8 comments

  • cPRex Jurassic Moderator
    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
  • ded_2004
    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
  • cPRex Jurassic Moderator
    Whoops, I missed part of that echo command - this will work: echo "" > /var/lib/mysql/server.log
    0
  • ded_2004
    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
  • cPRex Jurassic Moderator
    You'll definitely want to find the root cause of why the log file is growing so large, or else you'll continue to have issues. One thing you could do would be to temporarily enable the general query log to see all database queries that are happening on the system:
    0
  • ded_2004
    this file is powered by SQL settings
    0
  • ded_2004
    I disabled the log and it stopped recording information, problem solved, thanks for the support
    0
  • cPRex Jurassic Moderator
    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.