CentOS7에 MySQL 8.0 설치하는 거 생각보다 아주 까다롭다.
패키지도 없더니, GPG 키도 없다.
하지만! 해결 완료했다. 도움되길 바랍니다🥲
아래는 일반적인 MySQL 설치 방법이다.
오류가 발생했다면 스크롤을 내려 확인 바랍니다.
(1) 시스템의 모든 패키지 최신 버전으로 업데이트 (약 10분 소요)
# yum update -y
(2) mysql-server 설치
# yum install mysql-server
(3) 버전 및 설치 확인
# mysql --version
(4) 서비스 시작 및 부팅 시 자동 시작 설정
# systemctl start mysqld
# systemctl enable mysqld
# systemctl status mysqld
[오류 1] mysql-server 설치시, 패키지 없음
# yum install mysql-server
----- < ERROR > ------------------------------
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* extras: mirror.kakao.com
* updates: mirror.kakao.com
No package mysql-server available.
Error: Nothing to do
------------------------------------------------
# yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
충격적이게도, CentOS에는 기본적으로 MySQL 패키지가 포함되어 있지 않다.
따라서 필연적으로 공식 저장소를 시스템에 추가해야한다.
즉, 당연히 발생되는 오류라는거..
[오류 2] mysql-server 설치시, GPG 키 없음 (공개키)
# yum install mysql-server
----- < ERROR > -----------------------------------------------------------------------------------------------------
Public key for mysql-community-client-8.0.36-1.el7.x86_64.rpm is not installed
Failing package is: mysql-community-client-8.0.36-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022, file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
----------------------------------------------------------------------------------------------------------------------
(1) 공식 저장소 설정 파일인 mysql-community.repo에서 GPG 키 관련 설정 확인
# cat /etc/yum.repos.d/mysql-community.repo | grep gpgkey
(2) MySQL 공식 저장소에서 GPG 키 다운로드
# wget https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 -O RPM-GPG-KEY-mysql
// -O: 다운로드한 파일 이름 설정
(3) 다운로드 받은 GPG 키를 시스템에 추가
# rpm --import RPM-GPG-KEY-mysql
(4) mysql-server 설치
# yum install mysql-server
위의 과정을 수행하면 정상적으로 mysql-server가 정상적으로 설치된다.
(2) 부분을 해결하기 위해 구글링을 열심히 했는데
전부 https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 만 다운로드만 나와있었다.
하지만 안되길래 임의로 2023으로 변경했는데 됐다. 우하하.
요약하자면,
# yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
# wget https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 -O RPM-GPG-KEY-mysql
# rpm --import RPM-GPG-KEY-mysql
# yum install mysql-server
위의 순서대로 명령어 수행하면 정상적으로 MySQL8.0 설치가 완료된다. 끝👾
'여러가지 > DBMS' 카테고리의 다른 글
[MySQL][CentOS7] 8.0 외부 접속 설정 (1) | 2024.02.08 |
---|---|
[MySQL][CentOS7] 8.0 사용 (0) | 2024.02.08 |
[MySQL][CentOS7] 8.0 비밀번호 정책 변경 (0) | 2024.02.08 |
[MySQL][CentOS7] 8.0 접속 (0) | 2024.02.08 |
[설치] MariaDB (0) | 2023.12.15 |