Mysql consume lots of space in ubuntu 20.4

I need help regarding my application deployed in ec2 instance using T3 medium and Ubuntu 20. My problem is, I encountered a server error twice, it happens 3 months after each error. Prior to server error, I noticed I am greeted this message 99.5% of **GB once I log into the terminal console. The first server error happened three months ago I used a t2 tier, so without hesitation, I upgraded it to much bigger t3 with 30GB disk capacity. Now the error happens again, after 3 months or more. Again I noticed the 99.5% of 29.02GB and after few days I encountere the 500 error. I tried to investigate, I found out that the var/lib/mysql folder consumed a lot of space!. I am just wondering because my application is under in development, so data stored in mysql are minimal. So I tried to dump the db and inspect the stored data, its only less 1GB, and i have only 1 database in my ec2 instance.

Running sudo du lib -h, it shows 23G var/lib/mysql, I tried to restart the mysql server, the error is gone, but still the size doesnt change.

So my question is, why the folder lib/mysql consumed lots of space but in fact the actual data stored in database is just below 1 gb? So clearly, restarting mysql everytime an error encountered is just a temporary solution, and increasing the database space is not also the solution. Do you have idea what causes this and how to prevent this?. My application is still in development and I would like to solve the issue before deployment to production.

Many thanks.