Created
July 29, 2019 14:56
-
-
Save xuhang57/89edd0a3695931fc25a105db10cc6232 to your computer and use it in GitHub Desktop.
Mariadb drop database and free the disk space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# mysqldump -u[root] -p[root_password] [database_name] > [dbdump].sql | |
mysqladmin -u[root] -p[root_password] drop [database_name] | |
sudo systemctl stop mariadb | |
sudo rm /var/lib/mysql/ibdata1 | |
sudo rm /var/lib/mysql/ib_logfile* | |
sudo systemctl start mariadb | |
# mysqladmin -u[root] -p[root_password] create [database_name] | |
# mysqladmin -u[root] -p[root_password] [database_name] < [dbdump].sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment