IT/Linux

리눅스 서버에 MySQL 8 버전 설치하기.

오달달씨 2023. 7. 18. 17:58
728x90
반응형

리눅스 서버에 mysql 8.x 커뮤니티 버전을 설치해보자.. 

MySQL :: Download MySQL Yum Repository

 

MySQL :: Download MySQL Yum Repository

The MySQL Yum repository provides a simple and convenient way to install and update MySQL products with the latest software packages using Yum. The MySQL Yum repository provides MySQL packages the following Linux Distros: Red Hat Enterprise Linux / Oracle

dev.mysql.com

나의 서버의 버전은 redhat 8버전이니 Red Hat Enterprise Linux 8 / Oracle Linux 8 (Architecture Independent), RPM Package 를 다운받는다.

[dsms@~]$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.8 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.8 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.8
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.8"

다운로드 페이지 링크로 넘어가서 No thanks, just start my download. <- 여기에 우클릭을 해서 링크 주소를 복사.

 

RPM 다운로드, 설치하기

[dsms@ ~]$ sudo yum install -y https://dev.mysql.com/get/mysql80-community-release-el8-5.noarch.rpm

로컬 시스템 관리자에게 일반적인 지침을 받았으리라 믿습니다.
보통 세가지로 요약합니다:

    #1) 타인의 사생활을 존중하십시오.
    #2) 입력하기 전에 한 번 더 생각하십시오.
    #3) 막강한 힘에는 상당한 책임이 뒤따릅니다.
mysql80-community-release-el8-5.noarch.rpm        39 kB/s |  15 kB     00:00
종속성이 해결되었습니다.
=================================================================================
 꾸러미                         구조        버전         저장소             크기
=================================================================================
설치 중:
 mysql80-community-release      noarch      el8-5        @commandline       15 k

연결 요약
=================================================================================
설치  1 꾸러미

전체 크기: 15 k
설치된 크기 : 8.6 k
꾸러미 내려받기 중:
연결 확인 실행 중
연결 확인에 성공했습니다.
연결 시험 실행 중
연결 시험에 성공했습니다.
연결 실행 중
  준비 중     :                                                              1/1
  설치 중     : mysql80-community-release-el8-5.noarch                       1/1
  구현 중     : mysql80-community-release-el8-5.noarch                       1/1
   Warning: native mysql package from platform vendor seems to be enabled.
    Please consider to disable this before installing packages from repo.mysql.com.
    Run: yum module -y disable mysql

  확인 중     : mysql80-community-release-el8-5.noarch                       1/1
설치된 제품이 최신화되었습니다.

설치되었습니다:
  mysql80-community-release-el8-5.noarch

완료되었습니다!

mysql 8.x 설치

[dsms@ ~]$ sudo yum install -y mysql-server

나는 이 때 어떤 이슈를 맞딱뜨렸다. 그것은 바로

Errors during downloading metadata for repository 'mysql80-community':

   - status code: 404 for http://repo.mysql.com/yum/mysql-8.0-community/fc/8/x86_64/repodata/repodmd.xml

위의 URL로 접속해보면 실제로 404에러가 나타난다. 

이 에러를 해결하기 위해서 https://stackoverflow.com/questions/73080132/i-am-trying-to-install-mysql-in-fedora 여기를 참고하여 수정하였다.

 

I am trying to install MySQL in fedora

I am trying to install mysql and when I run the install command it keeps throwing the errors or returns failed to download. [root@fedora rk10]# dnf install mysql-community-server negativo17 - Nvidi...

stackoverflow.com

[dsms@ ~]$ cd /etc/yum.repos.d/
[dsms@ yum.repos.d]$ vi mysql-community.repo



[mysql80-community]
name=MySQL 8.0 Community Server
baseurl= http://repo.mysql.com/yum/mysql-8.0-community/el/38/$basearch/ 
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl= http://repo.mysql.com/yum/mysql-connectors-community/el/38/$basearch/ 
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl= http://repo.mysql.com/yum/mysql-tools-community/el/38/$basearch/ 
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-preview]
name=MySQL Tools Preview
baseurl= http://repo.mysql.com/yum/mysql-tools-preview/el/38/$basearch/ 
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-8.0-community]
name=MySQL Cluster 8.0 Community
baseurl= http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/38/$basearch/ 
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
~

mysqld 서비스 기동

[root@~]# systemctl start mysqld
### root 임시 비밀번호 확인
[root@~]# grep "temporary password" /var/log/mysql/mysqld.log    

mysql 접속

 

 

 

 

참고 : CentOS 7.9에 MySQL 8.x 설치하기 (blogger.pe.kr) 

728x90
반응형