snippetMinor
How to reset MariaDB into a "fresh install" state?
Viewed 0 times
installintofreshstatehowresetmariadb
Problem
I had InnoDB corruption and managed to start the server in read only mode and perform a fresh backup using
This way of starting the service puts the databases in read only mode, even deletion is disallowed.
Is there an official procedure to reset the whole server into a fresh installed (or at least "empty") version?
And in case there isn't, then what are the correct uninstall/reinstall steps to make sure there will be no remaining residues of data that could generate problems in the future?
innodb_force_recovery=5.This way of starting the service puts the databases in read only mode, even deletion is disallowed.
Is there an official procedure to reset the whole server into a fresh installed (or at least "empty") version?
And in case there isn't, then what are the correct uninstall/reinstall steps to make sure there will be no remaining residues of data that could generate problems in the future?
Solution
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:
At the start if no datafiles exists MariaDB will recreate the internal scheme
Say if you run MariaDB on a Debian you can do the next:
systemctl stop mysql
rm -rf /var/lib/mysql/*
systemctl start mysqlAt 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.Code Snippets
systemctl stop mysql
rm -rf /var/lib/mysql/*
systemctl start mysqlContext
StackExchange Database Administrators Q#261932, answer score: 8
Revisions (0)
No revisions yet.