How to completely uninstall MySQL under CentOS? Solve the problem of uninstalling dirty

Source: Internet
Author: User
Tags crc32 deprecated documentation

How to completely uninstall MySQL under CentOS? Solve the problem of uninstalling dirty

System:CentOS 6.5,mysql:mysql 5.6

The main solution here is to use rpm installation of the uninstall problem, installation method see: CentOS installation mysql*. RPM hint conflicts with file-from-Package workaround

Although this is the uninstall problem using rpm installation, I think the use of Yum installation will be the same if you encounter the same problem.

to view the services that are already installed rpm–qa|grep-i MySQL

-I action is case insensitive
you can see that there are two installation packages mysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
mysql-client-5.6.19-1.linux_glibc2.5.x86_64.rpm
Remove the two services (remove the suffix) rpm–e mysql-client-5.6.19-1.linux_glibc2.5.x86_64
Rpm-e mysql-server-5.6.19-1.linux_glibc2.5.x86_64

to view the remaining directories:

Whereis MySQL

then delete the MySQL directory:

Rm–rf/usr/lib64/mysql

Delete related files: rm–rf/usr/my.cnf
Rm-rf/root/.mysql_sercret

The most critical:

Rm-rf/var/lib/mysql

If this directory is not deleted and then reinstalled, the password will not be re-initialized!

On-line search for a long time did not mention this article, the end of their own groping to find out.
Uninstall complete! How do you know if it's really uninstalled?

One is to look at the installation output:

If you do not uninstall cleanly, you enter only two lines when you install the server:

[Email protected] opt]# RPM-IVH mysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpmpreparing ...                ########################################### [100%]   1:mysql-server           ##################################### ###### [100%]

Uninstall Clean the installation input is as follows:

[[email protected] opt]# rpm-ivh mysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpmpreparing ... ######## ################################### [100%] 1:mysql-server ########################################### [100%]20 14-09-23 07:22:43 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated.  --explicit_defaults_for_timestamp server option (see documentation for more details). 2014-09-23 07:22:43 26041 [Note] Innodb:using Atomics to ref count buffer pool pages2014-09-23 07:22:43 26041 [Note] innodb:the InnoDB memory heap is dis  abled2014-09-23 07:22:43 26041 [note] innodb:mutexes and rw_locks use GCC atomic builtins2014-09-23 07:22:43 26041 [note] innodb:compressed tables use zlib 1.2.32014-09-23 07:22:43 26041 [Note] innodb:using Linux native aio2014-09-23 07:22:4  3 26041 [note] innodb:using CPU crc32 instructions2014-09-23 07:22:43 26041 [Note] innodb:initializing buffer pool, size = 128.0m2014-09-23 07:22:43 26041 [Note] Innodb:compleTed initialization of buffer pool2014-09-23 07:22:43 26041 [Note] innodb:the first specified data file./ibdata1 did not EXIST:A new database to is created!2014-09-23 07:22:43 26041 [Note] innodb:setting file./ibdata1 size to Mb2014-09-2 3 07:22:43 26041 [Note] Innodb:database physically writes the file full:wait ... 2014-09-23 07:22:43 26041 [note] innodb:setting log file./ib_logfile101 size to ~ mb2014-09-23 07:22:43 26041 [note] in nodb:setting log file./ib_logfile1 size to mb2014-09-23 07:22:45 26041 [Note] innodb:renaming log file./ib_logfile1 /ib_logfile02014-09-23 07:22:45 26041 [Warning] innodb:new log files created, lsn=457812014-09-23 07:22:45 26041 [ Note] Innodb:doublewrite buffer not found:creating new2014-09-23 07:22:45 26041 [note] Innodb:doublewrite buffer Create d2014-09-23 07:22:45 26041 [Note] innodb:128 rollback segment (s) is active.2014-09-23 07:22:45 26041 [Warning] Innodb:c reating FOREIGN KEY constraint system tables.2014-09-23 07:22:4526041 [note] innodb:foreign key constraint system tables created2014-09-23 07:22:45 26041 [note] innodb:creating Tablesp Ace and DataFile system tables.2014-09-23 07:22:45 26041 [Note] innodb:tablespace and datafile system tables created.2014 -09-23 07:22:45 26041 [note] innodb:waiting for purge to start2014-09-23 07:22:45 26041 [note] innodb:5.6.19 started; Log sequence number 0A random root password has been set. You'll find it in '/root/.mysql_secret '. 2014-09-23 07:22:46 26041 [note] Binlog end2014-09-23 07:22:46 26041 [note] Inno Db:fts optimize thread exiting.2014-09-23 07:22:46 26041 [Note] innodb:starting shutdown ... 2014-09-23 07:22:48 26041 [Note] Innodb:shutdown completed; Log sequence number 16259772014-09-23 07:22:48 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated.  --explicit_defaults_for_timestamp server option (see documentation for more details). 2014-09-23 07:22:48 26065 [Note] Innodb:using Atomics to ref count buffer pool Pages2014-09-23 07:22:48 26065 [note] innodb:the InnoDB memory heap is disabled2014-09-23 07:22:48 26065 [note] innodb:mutexes and rw_ Locks use GCC atomic builtins2014-09-23 07:22:48 26065 [Note] innodb:compressed tables use zlib 1.2.32014-09-23 07:22:48  26065 [note] innodb:using Linux native aio2014-09-23 07:22:48 26065 [Note] innodb:using CPU CRC32 instructions2014-09-23 07:22:48 26065 [note] innodb:initializing buffer pool, size = 128.0m2014-09-23 07:22:48 26065 [note] innodb:completed I  Nitialization of buffer pool2014-09-23 07:22:48 26065 [Note] innodb:highest supported file format is barracuda.2014-09-23 07:22:48 26065 [Note] innodb:128 rollback segment (s) is active.2014-09-23 07:22:48 26065 [note] innodb:waiting for pur GE to start2014-09-23 07:22:48 26065 [Note] innodb:5.6.19 started; Log sequence number 16259772014-09-23 07:22:48 26065 [note] Binlog end2014-09-23 07:22:48 26065 [note] innodb:fts Optimiz E thread exiting.2014-09-23 07:22:48 26065 [Note] innodb:starting shutdown ...2014-09-23 07:22:50 26065 [Note] Innodb:shutdown completed; Log sequence number 1625987A RANDOM PASSWORD have BEEN SET for the MySQL root USER! You'll find that password in '/root/.mysql_secret '. You must change this password on your first connect,no other statement but ' SET password ' would be accepted. See the Manual for the semantics of the ' password expired ' flag. Also, the anonymous user has been removed. In addition, you can run:/usr/bin/mysql_secure_installationwhich would also give you the option of removing the test data Base. This is the strongly recommended for production servers. See the Manual for more instructions. Problems at Http://bugs.mysql.com/The latest information about MySQL was available on the Web at/http Www.mysql.comSupport MySQL by buying support/licenses at Http://shop.mysql.comNew Default Config file is created as/usr/ MY.CNF Andwill is used by default by the server when you start it. You could edit this file to the Change server settings 
The last paragraph prompted the important information, many people because do not like to read English, resulting in the next do not know how to operate!


Second, the installation is complete, after starting the service

Use the command: "Mysql-uroot-p" Enter your previous installation after the password set, see if you can log in, if you could log in, the instructions did not uninstall clean!

How to completely uninstall MySQL under CentOS? Solve the problem of uninstalling dirty

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.