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

Source: Internet
Author: User
Tags crc32 deprecated

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

System:CentOS 6.5,mysql:mysql 5.6

Here The main solution is to use the rpm Installation 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

Yum remove MySQL mysql-server mysql-libs compat-mysql51rm-rf/var/lib/mysqlrm/etc/my.cnf See if you have MySQL software: rpm-qa|grep MySQL has the words to continue to delete

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:

[Root @localhost opt]# RPM-IVH mysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-server ########################################### [100%]

Uninstall Clean the installation input is as follows:

[Root @localhost opt]# RPM-IVH mysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-server ########################################### [100%]
2014-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 pages
2014-09-23 07:22:43 26041 [Note] innodb:the InnoDB memory heap is disabled
2014-09-23 07:22:43 26041 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-09-23 07:22:43 26041 [Note] innodb:compressed tables use zlib 1.2.3
2014-09-23 07:22:43 26041 [Note] innodb:using Linux native AIO
2014-09-23 07:22:43 26041 [Note] innodb:using CPU CRC32 Instructions
2014-09-23 07:22:43 26041 [Note] innodb:initializing buffer pool, size = 128.0M
2014-09-23 07:22:43 26041 [Note] innodb:completed initialization of buffer pool
2014-09-23 07:22:43 26041 [Note] innodb:the first specified data file./ibdata1 did not exist:a new database to be creat ed!
2014-09-23 07:22:43 26041 [Note] innodb:setting file./ibdata1 size to MB
2014-09-23 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 + MB
2014-09-23 07:22:43 26041 [Note] innodb:setting log file./ib_logfile1 size to + MB
2014-09-23 07:22:45 26041 [Note] innodb:renaming log file./ib_logfile101 to./ib_logfile0
2014-09-23 07:22:45 26041 [Warning] innodb:new log files created, lsn=45781
2014-09-23 07:22:45 26041 [Note] innodb:doublewrite buffer not found:creating new
2014-09-23 07:22:45 26041 [Note] Innodb:doublewrite buffer created
2014-09-23 07:22:45 26041 [Note] innodb:128 rollback segment (s) is active.
2014-09-23 07:22:45 26041 [Warning] innodb:creating FOREIGN KEY constraint system tables.
2014-09-23 07:22:45 26041 [Note] innodb:foreign key constraint system tables created
2014-09-23 07:22:45 26041 [Note] innodb:creating tablespace 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 start
2014-09-23 07:22:45 26041 [Note] innodb:5.6.19 started; Log sequence number 0
A random root password has been set. You'll find it in '/root/.mysql_secret '.
2014-09-23 07:22:46 26041 [Note] Binlog End
2014-09-23 07:22:46 26041 [Note] innodb: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 1625977


2014-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 pages
2014-09-23 07:22:48 26065 [Note] innodb:the InnoDB memory heap is disabled
2014-09-23 07:22:48 26065 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-09-23 07:22:48 26065 [Note] innodb:compressed tables use zlib 1.2.3
2014-09-23 07:22:48 26065 [Note] innodb:using Linux native AIO
2014-09-23 07:22:48 26065 [Note] innodb:using CPU CRC32 Instructions
2014-09-23 07:22:48 26065 [Note] innodb:initializing buffer pool, size = 128.0M
2014-09-23 07:22:48 26065 [Note] innodb:completed initialization of buffer pool
2014-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 purge to start
2014-09-23 07:22:48 26065 [Note] innodb:5.6.19 started; Log sequence Number 1625977
2014-09-23 07:22:48 26065 [Note] Binlog End
2014-09-23 07:22:48 26065 [Note] innodb:fts optimize 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 1625987




A 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_installation

Which would also give you the option of removing the test database.
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.com

Support for MySQL by buying support/licenses at http://shop.mysql.com

New Default Config file was created as/usr/my.cnf and
Would be 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

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.