• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

/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