MySQL log High usage
Hi,
today i check my server /var/log and ls -lha | grep mysql it show two files.
-rw-r-----. 1 mysql mysql 42G Jul 22 09:00 mysqld.log
drwxr-xr-x 2 mysqlrouter mysqlrouter 4.0K May 31 17:45 mysqlrouter
mysqld.log file is 42g. is it normal? or should i have to delete it. why it become to larger.
-
A 42GB MySQL log file (mysqld.log) is unusually large and might indicate an issue with your MySQL server's logging settings or database activity. Log files are used to record various events and activities in MySQL, and they can grow over time depending on the level of logging enabled and the amount of activity on the server. - If the log file contains valuable information for debugging or monitoring purposes, consider implementing log rotation to manage log file sizes automatically.
- If the log file contains errors or warnings, address the underlying issues causing those errors to reduce future log growth.
- If the log file doesn't seem to have any critical information and you have limited disk space, you might consider deleting the file.
0 -
A 42GB MySQL log file (mysqld.log) is unusually large and might indicate an issue with your MySQL server's logging settings or database activity. Log files are used to record various events and activities in MySQL, and they can grow over time depending on the level of logging enabled and the amount of activity on the server.
- If the log file contains valuable information for debugging or monitoring purposes, consider implementing log rotation to manage log file sizes automatically.
- If the log file contains errors or warnings, address the underlying issues causing those errors to reduce future log growth.
- If the log file doesn't seem to have any critical information and you have limited disk space, you might consider deleting the file.
I"m not the expert. I don"t know it any important information is in log file. How can i check? If i delete, will i face any issue?0 -
Deleting the log file does not affect the service, but might make it difficult to diagnose issues in the future. Instead, you can truncate the log file to a smaller size using the below command. #truncate -s 50M /var/log/mysqld.log
It will reduce the file size to the most recent 50 Megabytes of data (retains the newest data and removes all older data in the file above the 50M in size). So once you find the0 -
Deleting the log file does not affect the service, but might make it difficult to diagnose issues in the future. Instead, you can truncate the log file to a smaller size using the below command.
#truncate -s 50M /var/log/mysqld.log
It will reduce the file size to the most recent 50 Megabytes of data (retains the newest data and removes all older data in the file above the 50M in size). So once you find the0 -
I am glad I was able to help. 0 -
What do you see in /etc/my.cnf ? 0
Please sign in to leave a comment.
Comments
6 comments