• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

/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