skip to Main Content

After Deleting Transients. Cleaning autoload Options. Setting log_days in my.cnf to 1, an many more tricks… My wp-options says its size is 50GB… however when I backup the file is 24MB.

I’m clearly missing something that is causing me huge binlog files and space problems on the server.

It as bitnami WordPress installation on a Lightsail server

Any clues will be appreciated

Thanks

2

Answers


  1. Summary of the comment thread above:

    A combination of using OPTIMIZE TABLE to defragment the InnoDB tables after deleting lots of data, and PURGE BINARY LOGS to prune the accumulated binary logs helped to reduce the storage usage.

    Login or Signup to reply.
  2. With MySQL8, they have turned on binary logging by default and the default purge (expiry/deletion) of binary logs is set to 30days.

    Once you are in your SSH and in mysql, you can use the below commands

    To show binary logs

    mysql> SHOW BINARY LOGS;
    

    To Purge binary logs manually until some point

    mysql> PURGE BINARY LOGS TO 'binlog.000142';
    

    Change automatic default purge expiry from 30days (deafault) to 3days

    mysql> SET GLOBAL binlog_expire_logs_seconds = (60*60*24*3);
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SET PERSIST binlog_expire_logs_seconds = (60*60*24*3);
    Query OK, 0 rows affected (0.01 sec)
    

    The above value is in seconds, i.e. 3 days in seconds = (60 seconds x 60 minutes x 24 hours x 3 days)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search