Skip to main content

MariaDB can be reverted to the fresh state by removing its data files.

Say if you run MariaDB on a Debian you can do the next:

systemctl stop mysql
rm -rf /var/lib/mysql/*
sudo -u mysql mysql_install_db 
systemctl start mysql

AtFor some versions of Debian, the startmysql_install_db step is not necessary; when starting up if no datafiles exists MariaDB will recreate the internal scheme mysql.* with all default values. 

All leftovers like config and log files you have to clean up by handsmanually.

MariaDB can be reverted to the fresh state by removing its data files.

Say if you run MariaDB on a Debian you can do the next:

systemctl stop mysql
rm -rf /var/lib/mysql/*
systemctl start mysql

At the start if no datafiles exists MariaDB will recreate the internal scheme mysql.* with all default values. All leftovers like config and log files you have to clean up by hands.

MariaDB can be reverted to the fresh state by removing its data files.

Say if you run MariaDB on a Debian you can do the next:

systemctl stop mysql
rm -rf /var/lib/mysql/*
sudo -u mysql mysql_install_db 
systemctl start mysql

For some versions of Debian, the mysql_install_db step is not necessary; when starting up if no datafiles exists MariaDB will recreate the internal scheme mysql.* with all default values. 

All leftovers like config and log files you have to clean up manually.

Source Link
Kondybas
  • 4.6k
  • 17
  • 14

MariaDB can be reverted to the fresh state by removing its data files.

Say if you run MariaDB on a Debian you can do the next:

systemctl stop mysql
rm -rf /var/lib/mysql/*
systemctl start mysql

At the start if no datafiles exists MariaDB will recreate the internal scheme mysql.* with all default values. All leftovers like config and log files you have to clean up by hands.