MYSQL Leaves Junk on Server

Ubuntu 20.04 Server
After creating a large data table in PHP My admin, 1 GB of disk space was used.
After dropping the table, and restarting MYSQL server only 0.4 GB was freed up.
Is there a way to gain back 100% of the disk space after dropping tables / databases?
Thanks

I found 17 GB of logfiles that were collected in a week or two.
I found the solution:
in file manager find the last log file in /var/lib/mysql eg. binlog.000146
run mysql command eg: PURGE BINARY LOGS TO ‘binlog.000146’;
that cleans out the junk.
But is there a solution to disable database logging completely?

The binlog is not a log for humans you can just throw away or disable. It’s part of the reliability design of the database.

https://dev.mysql.com/doc/refman/5.7/en/binary-log.html

Finally found the solution
/etc/mysql/mysql.conf.d/mysqld.cnf
add to the end of the file :
disable-log-bin

Now logging is disabled. Collecting 17 GB of junk in less than 2 weeks is a nonsense

Did you even read what @Joe said? This is NOT something that should be disabled!

If you actually managed to collect 17GB there in a few weeks I would say you might have a serious design flaw in database/script/whatever you’re running…

I just started building this server, so no sensitive data to lose. A few times created and dropped large data tables and noticed that the junk is just keeps on growing. I opened the log files and noticed that there are stored the complete copies of the data tables. Even if you drop a table, the archived copies never disappear. That simply does not make any sense.

I mean, if you don’t care about data loss, do whatever you want. rm -rf everything, I don’t care, it’s your system. :wink:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.