mySQL database size large, but tables size less

I have my site hosted with NetworkSolution, and they have a sql database size limit of 300MB. IF the size exceeds this limit we cannot access the wordpress admin dashboard. So currently its showing 441MB, and its overlimit. And they are force me to upgrade the database size to 1GB for 120$/yearly.

But previously I had all tables size totaling to 45MB, but the database size was 321MB, and I had to request them to grant me access, so they use to resync/optimise the database, so it gets the actual size around 60MB.

But now they claim that my site has increased the database size to 441MB.

How can I check what table is taking the max storage? or whats causing the database size to increase?

thanks

Topic post-thumbnails mysql database Wordpress

Category Web


export( download) your db and import it in local mysql ( or with XAMP ) then you can analyse it


It could be because bigger than needed because Wordpress keeps in it some old stuff like post revisions, autodrafts, orphaned or duplicated meta... this could be easily cleaned using WP-Sweep plugin as long as you can run it on your site. I'm not sure how is your situation right now, are you able to use wp-admin or not. Anyway:

  1. As a first step I'd recommend backing up your database using PHPmyAdmin or much smaller alternative - PHPminiAdmin. With any of those tools you can also see the size of the tables, so you can check if the hosting company doesn't lie to you. Notice that besides the table size, for each table there's and index which depending on the table structure can take a reasonable space too.

  2. a) If you have access to the wp-admin - install the plugin and do some cleaning - the options are quite self-explanatory.

  3. b) If you don't have wp-admin access and you don't want to pay for an upgrade I think you should download the database and the files and setup your site somewhere else just for the sake of running the plugin and cleaning the database. Many hosting companies offer a free trial period. Alternatively you can set up the site on you local machine using XAMP server setup for instance and do the same. Having cleaned up the DB you can upload it back to the server.

From my experience sometimes the Wordpress database can take many times more space than really needed, because of the trash collected with the years of working, so you could win this situation not paying for the upgrade.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.