Clean database ubuntu/RHEL/SUSE use uninstall_package and clean /var/lib/mysql
Change-Id: I72c9df06903e536320a807fae8b817379e448444
Related-Bug: #1395776
diff --git a/lib/databases/mysql b/lib/databases/mysql
index d39d966..0e423de 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -23,22 +23,27 @@
if is_ubuntu; then
# Get ruthless with mysql
stop_service $MYSQL
- apt_get purge -y mysql*
+ uninstall_package mysql-server mariadb-server
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
return
elif is_fedora; then
if [[ $DISTRO =~ (rhel6) ]]; then
- MYSQL=mysqld
+ stop_service mysqld
+ uninstall_package mysql-server
+ sudo rm -rf /var/lib/mysql
else
- MYSQL=mariadb
+ stop_service mariadb
+ uninstall_package mariadb-server
+ sudo rm -rf /var/lib/mysql
fi
elif is_suse; then
- MYSQL=mysql
+ stop_service mysql
+ uninstall_package mysql-community-server
+ sudo rm -rf /var/lib/mysql
else
return
fi
- stop_service $MYSQL
}
function recreate_database_mysql {