Completely uninstall MySQL reinstall under Ubuntu

Source: Internet
Author: User
Tags administrator password

1. Delete MySQL

sudo apt-get autoremove--purge mysql-server-5.0sudo apt-get remove Mysql-serversudo apt-get autoremove Mysql-serversudo Apt-get Remove Mysql-common (very important)

Clean up residual data

Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p


2. Install MySQL

sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo apt-get Install Php5-mysql ( 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

3. Enter MySQL

$mysql-uroot-p Administrator Password
Configure the Administrator password for MySQL:

sudo mysqladmin-u root password newpassword


Completely uninstall MySQL reinstall under Ubuntu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.