Home Database Mysql Tutorial MySQL-Completely uninstall MySQL code example under CentOS

MySQL-Completely uninstall MySQL code example under CentOS

Mar 14, 2017 pm 04:42 PM

1. Check whether MySQL is installed

## Method 1:

1

2

3

4

5

6

7

8

9

10

11

[root@localhost usr]# yum list installed mysql*

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.yun-idc.com

 * extras: mirror.neu.edu.cn

 * updates: mirrors.yun-idc.com

Installed Packages

MySQL-client.x86_64   5.6.27-1.el6    installed

MySQL-devel.x86_64    5.6.27-1.el6    installed

MySQL-server.x86_64   5.6.27-1.el6    installed

[root@localhost usr]#

Copy after login

Method 2(

- i : case-insensitive):

1

2

3

4

5

[root@localhost usr]# rpm -qa | grep -i mysql

MySQL-server-5.6.27-1.el6.x86_64

MySQL-client-5.6.27-1.el6.x86_64

MySQL-devel-5.6.27-1.el6.x86_64

[root@localhost usr]#

Copy after login

2. Uninstall MySQL

Uninstall 1:

1

2

3

[root@localhost usr]# yum remove mysql mysql-server mysql-libs compat-mysql51

[root@localhost usr]# rm -rf /var/lib/mysql

[root@localhost usr]# rm /etc/my.cnf

Copy after login

If mysql-devel is installed (the same as add command for others), uninstall it as:


1

[root@Tony_ts_tian init.d]# yum remove mysql mysql-devel mysql-server mysql-libs compat-mysql51

Copy after login

Note (for example):

mysql-5.5.39-1 .el6.remi.x86_64
mysql-libs-5.5.39-1.el6.remi.x86_64
compat-mysql51-5.1.54-1.el6.remi.x86_64
mysql-server-5.5 .39-1.el6.remi.x86_64
Uninstall 2{Continue, choose one of 1 and 2 (here is the introduction):}:

1

2

3

4

5

6

7

8

9

[root@localhost mysql]# rpm -aq | grep -i mysql

MySQL-server-5.6.27-1.el6.x86_64

MySQL-client-5.6.27-1.el6.x86_64

MySQL-devel-5.6.27-1.el6.x86_64

[root@localhost mysql]# rpm -e MySQL-server-5.6.27-1.el6.x86_64

[root@localhost mysql]# rpm -e MySQL-client-5.6.27-1.el6.x86_64

[root@localhost mysql]# rpm -e MySQL-devel-5.6.27-1.el6.x86_64

[root@localhost rc.d]# cd /var/lib/

[root@localhost lib]# rm -rf mysql/

Copy after login

Note : Delete the MySQL database directory (key), otherwise the password will not be updated (default installation, if you customize the installation path and link path ln -s... please delete it.)

rm -rf /var/lib/mysql

Uninstall 3:

1

2

3

[root@localhost usr]# whereis mysql

mysql: /usr/lib64/mysql

[root@localhost usr]# rm -rf /usr/lib64/mysql

Copy after login

Note: find / -name mysql

Note: Clear all directories and files related to mysql and other configurations and settings. If there is, delete it. You must also consider whether other software will affect it.
rm -rf /usr/lib/mysql
rm -rf /usr/share/mysql

Uninstall 4:

1

2

[root@localhost usr]# rm –rf /usr/my.cnf

[root@localhost usr]# rm -rf /root/.mysql_sercret

Copy after login

Uninstall 5 (self-starting service):

1

2

[root@localhost usr]# chkconfig --list | grep -i mysql

[root@localhost usr]# chkconfig --del mysqld

Copy after login

1

此处删除看自己设置:mysql/mysqld

Copy after login

The above is the detailed content of MySQL-Completely uninstall MySQL code example under CentOS. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to optimize CentOS HDFS configuration How to optimize CentOS HDFS configuration Apr 14, 2025 pm 07:15 PM

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

Centos stops maintenance 2024 Centos stops maintenance 2024 Apr 14, 2025 pm 08:39 PM

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

How to check CentOS HDFS configuration How to check CentOS HDFS configuration Apr 14, 2025 pm 07:21 PM

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

Centos shutdown command line Centos shutdown command line Apr 14, 2025 pm 09:12 PM

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

Centos configuration IP address Centos configuration IP address Apr 14, 2025 pm 09:06 PM

Steps to configure IP address in CentOS: View the current network configuration: ip addr Edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change IP address: Edit IPADDR= Line changes the subnet mask and gateway (optional): Edit NETMASK= and GATEWAY= Lines Restart the network service: sudo systemctl restart network verification IP address: ip addr

Centos install mysql Centos install mysql Apr 14, 2025 pm 08:09 PM

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

See all articles