The following article describes how to delete a MySQL database from ubuntu and how to reinstall and delete a MySQL database from ubuntu. If you are interested in the operation, you can browse the following articles.
- 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
It is very important that some of the above are redundant.
Clean residual data
- dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
Install MySQL database
- sudo apt-get install MySQL-serversudo apt-get install MySQL-clientsudo apt-get install php5-MySQL
Installing the php5-MySQL database is to connect php and MySQL once the installation is complete, the MySQL server should be started automatically. 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 a line similar to the following:
- tcp 0 0 localhost.localdomain:MySQL *:* LISTEN -
If the server cannot run properly, run the following command to start it:
- sudo /etc/init.d/MySQL restart
Go to MySQL
$ MySQL-uroot-p administrator password
Configure the MySQL database administrator password:
- sudo MySQLadmin -u root password newpassword
The above content introduces how to thoroughly Delete the MySQL database from ubuntu and then reinstall MySQL to delete MySQL. I hope you will get some benefits.