1. Delete MySQL
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)
In fact, some of the above are redundant. We recommend that you execute them in sequence.
Clean residual data
Dpkg - L | Grep ^ RC | Awk ' {Print $2} ' | Sudo xargs dpkg - P
2. Install MySQL
1 Sudo Apt - Get install MySQL - Server
2 Sudo Apt - Get install MySQL - Client
3 Sudo Apt - Get install PhP5 - MySQL ( Install 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:
1 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:
1 Sudo/Etc/Init. d/MySQL restart
3. Enter MySQL
$ Mysql-uroot-P administrator password
Configure the MySQL administrator password:
1 Sudo mysqladmin - U Root Password newpassword
Original post