본문 바로가기
DataBase/mysql

linux mysql 삭제 , centos

by 아이티.파머 2022. 5. 11.
반응형

linux mysql 삭제 , centos

[(EOL) ~]$ sudo yum remove -y mysql-community-*

Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.38-1.el7 will be erased
---> Package mysql-community-common.x86_64 0:5.7.38-1.el7 will be erased
---> Package mysql-community-libs.x86_64 0:5.7.38-1.el7 will be erased
---> Package mysql-community-server.x86_64 0:5.7.38-1.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================
 Package                                                  Arch                                     Version                                           Repository                                            Size
================================================================================================================================================================================================================
Removing:
 mysql-community-client                                   x86_64                                   5.7.38-1.el7                                      @mysql57-community                                   106 M
 mysql-community-common                                   x86_64                                   5.7.38-1.el7                                      @mysql57-community                                   2.8 M
 mysql-community-libs                                     x86_64                                   5.7.38-1.el7                                      @mysql57-community                                   9.9 M
 mysql-community-server                                   x86_64                                   5.7.38-1.el7                                      @mysql57-community                                   771 M

Transaction Summary
================================================================================================================================================================================================================
Remove  4 Packages

Installed size: 890 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : mysql-community-server-5.7.38-1.el7.x86_64                                                                                                                                                   1/4 
  Erasing    : mysql-community-client-5.7.38-1.el7.x86_64                                                                                                                                                   2/4 
  Erasing    : mysql-community-libs-5.7.38-1.el7.x86_64                                                                                                                                                     3/4 
  Erasing    : mysql-community-common-5.7.38-1.el7.x86_64                                                                                                                                                   4/4 
  Verifying  : mysql-community-server-5.7.38-1.el7.x86_64                                                                                                                                                   1/4 
  Verifying  : mysql-community-client-5.7.38-1.el7.x86_64                                                                                                                                                   2/4 
  Verifying  : mysql-community-common-5.7.38-1.el7.x86_64                                                                                                                                                   3/4 
  Verifying  : mysql-community-libs-5.7.38-1.el7.x86_64                                                                                                                                                     4/4 

Removed:
  mysql-community-client.x86_64 0:5.7.38-1.el7        mysql-community-common.x86_64 0:5.7.38-1.el7        mysql-community-libs.x86_64 0:5.7.38-1.el7        mysql-community-server.x86_64 0:5.7.38-1.el7       

Complete!

# 폴더 삭제 
[(EOL) ~]$ rm -rf /var/lib/mysql

#rmp 설치 확인 및  삭제 
[(EOL) ~]$ rpm -qa | grep mysql
mysql57-community-release-el7-11.noarch
[(EOL) ~]$ sudo rpm -e mysql57-community-release 

# rmp 파일 확인 및 제거  
[(EOL) ~]$ sudo find / -name 'mysql*rpm'
/var/tmp/yum-root-ngjkdo/mysql57-community-release-el6-11.noarch.rpm
/home/mezzo/mysql57-community-release-el7-11.noarch.rpm
[(EOL) ~]$ 

[(EOL) ~]$ rm -rf /var/tmp/yum-root-ngjkdo/mysql57-community-release-el6-11.noarch.rpm
[(EOL) ~]$ rm -rf ****/home/mezzo/mysql57-community-release-el7-11.noarch.rpm

폴더 추가 삭제 항목

sudo rm -rf /etc/mysql /var/lib/mysql
sudo rm -rf /var/log/mysql
sudo rm -rf /var/log/mysql.*

재설치

[(EOL) ~]$ sudo yum -y install <http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm>
Loaded plugins: fastestmirror, langpacks
mysql57-community-release-el7-11.noarch.rpm                                                                                                                                              |  25 kB  00:00:00     
Examining /var/tmp/yum-root-ngjkdo/mysql57-community-release-el7-11.noarch.rpm: mysql57-community-release-el7-11.noarch
Marking /var/tmp/yum-root-ngjkdo/mysql57-community-release-el7-11.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================
 Package                                                 Arch                                 Version                              Repository                                                              Size
================================================================================================================================================================================================================
Installing:
 mysql57-community-release                               noarch                               el7-11                               /mysql57-community-release-el7-11.noarch                                31 k

Transaction Summary
================================================================================================================================================================================================================
Install  1 Package

Total size: 31 k
Installed size: 31 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : mysql57-community-release-el7-11.noarch                                                                                                                                                      1/1 
  Verifying  : mysql57-community-release-el7-11.noarch                                                                                                                                                      1/1 

Installed:
  mysql57-community-release.noarch 0:el7-11                                                                                                                                                                     

Complete!
반응형

'DataBase > mysql' 카테고리의 다른 글

mysql data backup (dump)  (0) 2022.05.11
mysql collate 변경 column , table  (0) 2020.11.30
cent os 7 mysql 8 설치  (0) 2020.09.15
Mysql 이모지(이모티콘) 4byte 적용  (0) 2019.05.08
mysql 사용자 추가 DB 권한부여  (0) 2018.09.18