Ubuntu12.04 uninstall MySQL 1sudoapt-getautoremove -- purgemysql-server-5.02sudoapt-getremovemysql-server3sudoapt-getautoremovemysql-server4sudoapt-getremovemysql-common (very important) 2nd
Uninstall MySQL in Ubuntu 12.04
Step 1
1 sudo apt-get autoremove -- purge mysql-server-5.0
2 sudo apt-get remove mysql-server
3 sudo apt-get autoremove mysql-server
4 sudo apt-get remove mysql-common (very important)
Step 2: Clear residual data
1 dpkg-l | grep ^ rc | awk '{print $2}' | sudo xargs dpkg-P
Step 3: Install MySQL
1 sudo apt-get install mysql-server
2 sudo apt-get install mysql-client
3 sudo apt-get install php5-mysql (installation php5-mysql is to connect php and mysql)
Once the installation is complete, the MySQL server should be started automatically. You can run the following command at a 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
Step 4: configure the Administrator Password
Go to mysql
$ Mysql-uroot-p administrator password
Configure the MySQL administrator password:
Sudo mysqladmin-u root password newpassword
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2