I did some cleanup of MySQL last night and this morning. Basically the forum database based on phpBB was out of control and had grown huge along with the MySQL files in /var/lib/mysql/ for that database along with the “ibdata1” file and log files also in that directory.
I ended up taking the following steps:
- Cleared some file space since I was @ 100% by uninstalling some unneeded packages
- Insured that all the databases were error free:
- “mysqlcheck –repair –all-databases
- Dumped the databases to another directory in my home directory where I keep backup files using “Webmin”.
- Dropped all of the databases
- Stopped MySQL using “systemctl”:
- “systemctl stop mysqld.service”
- Copied the ibdata1 file and accompanying log files to my backup directory just in case I needed to recreate the environment.
- Restarted MySQL service:
- “systemctl start mysqld.service”
- Restored all of the individual database schemas using MySQL Workbench not having anything to do with phpBB forums
- Decided I would try to keep the current database schema for the phpBB forums but since I had done little decided it would be a waste of time.
- Dropped the forum phpBB database again after I had restored it and it continued to take up lots of space and there were no tools I found in phpBB to prune the database
- Stopped MySQL
- “systemctl stop mysqld.service”
- This time deleted/var/lib/ibdata1 and associated log files
- Started MySQL
- “systemctl start mysqld.service”
- Reinstalled phpBB using my current customized config files but with new database I created.