Uninstall MySQL server and client from Ubuntu

 Uninstall MySQL server and client from Ubuntu

 

sudo service mysql stop
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql/
sudo rm -rf /etc/mysql/

RE-INSTALL

 sudo apt-get install mysql-server mysql-client

If in case you got this error in trying to login: 

sudo systemctl stop mysql.service

sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld


sudo mysqld_safe --skip-grant-tables --skip-networking &
sudo mysql -u root

 CHANGE THE ROOT PASSWORD:

FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
exit;

sudo pkill mysqld_safe
mysql -u root -p


"provide your password and login"

 

 

 

 

 

 

Comments

Popular posts from this blog

Convert binary to decimal in c using built in function

Install nodeJs in linux

DFS in Complete Tree