• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

/var/log/mysqld.general.log huge

GrzegorzSS

New Pleskian
Hello

I found that my /var/log/mysqld.general.log file is really huge 152 GB

-rw-r--r-- 1 mysql mysql 152G Jul 14 22:20 mysqld.general.log

Any idea how to safly purge it without affecting mysql service ? and how to disable logging ?

Thanks
Greg
 
in mysql database check following:

mysql> show variables where variable_name = 'general_log';

and set it to OFF state:

mysql> set global general_log = 0;

After that you should see:

mysql> show variables where variable_name = 'general_log';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| general_log | OFF |
+---------------+-------+
1 row in set (0.00 sec)
 
Hello IgorG thanks for your reply, can you please clarify on which database I should change it ? PSA database or maybe particular application databases I have ?
I tried both PSA and normal dbs but I cound`t find that parameter I`m doing smth wrong

How to clear old log later on ?
 
Ok i found I connected as follow to one of my business database mysql -uadmin -p`cat /etc/psa/.psa.shadow` DATABASE_NAME
then I executed

root@host1 ~ # mysql -uadmin -p`cat /etc/psa/.psa.shadow` mobile
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1369805
Server version: 5.0.95-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables where variable_name = 'general_log';
Empty set (0.00 sec)

mysql>
 
Ok I found the issue in root@host1 /etc # more my.cnf

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
# Forced OLD_PASSWORD format is turned OFF by Plesk
#old_passwords=1
bind-address=127.0.0.1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
log=/var/log/mysqld.general.log

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


I`m going to remove that line and disable [mysqld_safe] section. Can you confirm ? after that service mysqld restart should be executed right ? after mysqld restart anything else is required or my dbs will bring up as normal ?
 
Back
Top