Ubuntu completely remove MySQL

Delete MySQL

sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common //This is very important
Some of the above are actually redundant

Clean up residual data#

dpkg -l |grep ^rc|awk '{print $2}'|sudo xargs dpkg -P

Install MySQL

sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql 
//Install php5-mysql is to connect php and mysql
Once the installation is complete, the MySQL server should start automatically. You can run the following command at the terminal prompt to check whether the MySQL server is running:
sudo netstat -tap | grep mysql

When you run this command, you can see lines similar to the following:

tcp 0 0 localhost.localdomain:mysql : LISTEN -

If the server cannot run normally, you can start it with the following command:

sudo /etc/init.d/mysql restart

Enter mysql

$mysql -uroot -p administrator password

Configure the MySQL administrator password:

sudo mysqladmin -u root password newpassword

sudo apt-get autoremove mysql-client

sudo apt-get autoremove mysql-client-core-5.5

Reference recommendation:

You might want to run'apt-get -f install' to correct these in the installation software under the ubuntu map

UBUNTU completely delete MYSQL and reinstall MYSQL

Ubuntu Server 12.04 install mysql 5.6.10 study notes

MySQL 5.1 Reference Manual (recommended)

Recommended Posts

Ubuntu completely remove MySQL
Ubuntu completely uninstall mysql turn
Ubuntu14 upgrade MySQL
Install mysql under Ubuntu 16.04
Install mysql on Ubuntu 14.04
Ubuntu19 install MySQL pit
Install MySQL under Ubuntu
Install Mysql offline on Ubuntu
Install and configure MySQL on Ubuntu
MySQL connected to remote Ubuntu server
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Ubuntu install MySQL password initialization problem
How to install mysql in Ubuntu 14.04
How to install MySQL on Ubuntu 14.04
Remove root password verification strategy under ubuntu
Set UTF-8 encoding for MySQL5.7 in Ubuntu 16.04
How to install MySQL on Ubuntu 18.04 (linux)
A little experience using mysql on Ubuntu
How to change MySQL password under Ubuntu
Configure Nginx + PHP 7.0 + MySQL environment under Ubuntu 16.04