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 important
In fact, some of the above is superfluous.
Clean up residual data
Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p
Install MySQL
sudo apt-get install Mysql-server
sudo apt-get install mysql-client
Installing Php5-mysql is to connect PHP with MySQL.
Once the installation is complete, the MySQL server should start automatically. You can check whether the MySQL server is running by running the following command at the terminal prompt:
sudo netstat-tap | grep MySQL
When you run the command, you can see a line similar to the following:
TCP 0 0 Localhost.localdomain:mysql *:* LISTEN-
If the server does not function correctly, you can start it by using the following command:
Sudo/etc/init.d/mysql restart
Go to MySQL
$mysql-uroot-p Administrator Password
Configure the Administrator password for MySQL:
sudo mysqladmin-u root password newpassword
Ubuntu completely remove MySQL