How to install and uninstall mysql in linux

Source: Internet
Author: User

How to install and uninstall mysql in linux
Install mysql

1. yum list | grep mysql // view the downloadable mysql database version provided on yum

2. yum install-y mysql-server mysql-devel // yum install mysql

3. service mysqld start // start mysql

4. mysqladmin-u root password '200' // set the User password

5. Set mysql users

Mysql> use mysql;

Mysql> update user set password = password ('000000') where user = 'root' and host = 'localhost ';

Mysql> flush privileges;

6. chkconfig mysqld on // set startup

7. chkconfig -- list | grep mysql // view the startup status

8. grant all privileges on *. * TO root @ '%' identified by '000000' with grant option; // allow remote connection

Uninstall mysql

1. Uninstall the program

Rpm-qa | grep-I mysql // view installed mysql

Rpm-ev MySQL-client-5.5.25a-1.rhel5 // uninstall to view results in the list

Rpm-ev MySQL-client-5.5.25a-1.rhel5 -- nodeps // use the force uninstall command if an error is reported

Rpm-e -- noscripts MySQL-client-5.5.25a-1.rhel5 // if an error is returned, try this command

2. Find a directory and delete all files under the Directory

Find/-name mysql // find all mysql-Related Files

Rm-rf/var/lib/mysql // remove the files in the search results one by one

3. Delete the configuration file

Rm-rf/etc/my. cnf // Delete the configuration file that is not in the list above

4. Check whether the uninstallation is complete

Find/-name mysql

Rpm-qa | grep-I mysql

If they are empty, the operation is complete.

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.