July 7, 2021 . 1 MIN READ
For a linux system, steps 1-6 can be accomplished with these commands:
mysqldump -u [username] -p[root_password] [database_name] > dumpfilename.sql mysqladmin -u [username] -p[root_password] drop [database_name]sudo /etc/init.d/mysqld stop sudo rm /var/lib/mysql/ibdata1sudo rm /var/lib/mysql/ib_logfile*sudo /etc/init.d/mysqld start mysqladmin -u [username] -p[root_password] create [database_name]mysql -u [username] -p[root_password] [database_name] < dumpfilename.sqlWarning: these instructions will cause you to lose other databases if you have other databases on this mysql instance. Make sure that steps 1,2 and 6,7 are modified to cover all databases you wish to keep.
https://stackoverflow.com/questions/3456159/how-to-shrink-purge-ibdata1-file-in-mysql