During the offline server disaster recovery test today, I used shell to operate the database and accidentally dropped several databases of mysql. Instead, I tried to reinstall mysql and recovered it by myself,
During the offline server disaster recovery test today, I used shell to operate the database and accidentally dropped several databases of mysql. Instead, I tried to reinstall mysql and recovered it by myself,
Preface
During the offline server disaster recovery test today, I used shell to operate the database. I accidentally dropped some of the databases that come with mysql. Instead, I tried to reinstall mysql and recovered it on my own, haha, the ideas left by windows users are cool. Record the operations I used to completely delete mysql under Ubuntu.
Delete mysql
1. sudo apt-get autoremove -- purge mysql-server-5.5
2. sudo apt-get remove mysql-common
Clean residual data
Dpkg-l | grep ^ rc | awk '{print $2}' | sudo xargs dpkg-P
Reinstall mysql
1. sudo apt-get install mysql-server
2. sudo apt-get install mysql-client
3. sudo apt-get install php5-mysql