mysql

* Take dump of all databases:
# mysqldump --skip-lock-tables -A > alldb.sql * * Check where MySQL keeps its files(in my case it's /var/lib/mysql/):
# mysql -NBe "SELECT @@datadir" * /var/lib/mysql/ * * Stop MySQL
# mysqladmin shut * * Move old MySQL files to safe place 
# mv /var/lib/mysql /var/lib/mysql.old * * Create new system database
# mkdir /var/lib/mysql * # sudo apt-get install mysql-server * * Start MySQL
# /etc/init.d/mysql start * * Restore the dump
#...

Read More
mysql

sudo -i service mysql stop killall -KILL mysql mysqld_safe mysqld apt-get --yes purge mysql-server mysql-client apt-get --yes autoremove --purge apt-get autoclean deluser --remove-home mysql delgroup mysql rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld updatedb exit...

Read More