How to uninstall mysql and install mysql in ubuntu

Source: Internet
Author: User
Tags mysql in

Three installation methods:

1. install sudo apt-get install mysql-server from the Internet. After the environment variables have been automatically configured, you can directly use the mysql command.

Note: We recommend that you change cn in/etc/apt/source. list to us, and the servers in the United States are much faster than those in China.

2. Install the release package. Take mysql-5.0.45-linux-i686-icc-glibc23.tar.gz as an example.

3. Binary package installation: environment variables have been automatically configured after installation. You can directly use the mysql command

Online installation and binary package installation are relatively simple, with emphasis on the installation of offline packages.

The code is as follows: Copy code

1. groupadd mysql

2. mkdir/home/mysql

3. useradd-g mysql-d/home/mysql

4. copy the mysql-5.0.45-linux-i686-icc-glibc23.tar.gz to the/usr/local directory

5. Unzip the tar zxvf mysql-5.0.45-linux-i686-icc-glibc23.tar.gz

6. ln-s mysql-5.0.45-linux-i686-icc-glibc23 mysql

7. cd/usr/local/mysql

8. chown-R mysql.

9. chgrp-R mysql.

10. scripts/mysql_install_db -- user = mysql (be sure to run the command in the mysql Directory. Note that the output text contains the command to change the root password and start mysql)

11. Set the password for root:./bin/mysqladmin-u root password 'passw0rd'


Uninstalling mysql from ubuntu


Delete mysql

The code is as follows: Copy code

1. sudo apt-get autoremove -- purge mysql-server-5.5

2. sudo apt-get remove mysql-common

Clean residual data

The code is as follows: Copy code

Dpkg-l | grep ^ rc | awk '{print $2}' | sudo xargs dpkg-P

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.