linux os : rocky linux 9.x
mysql : mysql 8.x
1. repository 설치 rpm 파일 다운로드
https://dev.mysql.com/downloads/repo/yum/
해당 다운로드 버튼에 링크를 복사
wget https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
--2022-11-15 10:05:44-- https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 104.74.173.121, 2600:1410:2000:1b1::2e31, 2600:1410:2000:194::2e31
Connecting to dev.mysql.com (dev.mysql.com)|104.74.173.121|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://repo.mysql.com//mysql80-community-release-el9-1.noarch.rpm [following]
--2022-11-15 10:05:44-- https://repo.mysql.com//mysql80-community-release-el9-1.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 96.17.188.242
Connecting to repo.mysql.com (repo.mysql.com)|96.17.188.242|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10534 (10K) [application/x-redhat-package-manager]
Saving to: ‘mysql80-community-release-el9-1.noarch.rpm’
mysql80-community-re 100%[======================>] 10.29K --.-KB/s in 0s
2022-11-15 10:05:45 (52.5 MB/s) - ‘mysql80-community-release-el9-1.noarch.rpm’ saved [10534/10534]
2. repository rpm 설치
dnf install -y mysql80-community-release-el9-1.noarch.rpm
해당 rpm 설치시 /etc/yum.repos.d 에 mysql repo가 추가 됩니다.
[yum.repos.d]# ls -al
-rw-r--r-- 1 root root 951 Jul 6 18:03 mysql-community-debuginfo.repo
-rw-r--r-- 1 root root 871 Jul 6 18:03 mysql-community-source.repo
-rw-r--r-- 1 root root 827 Jul 6 18:03 mysql-community.repo
# cat mysql-community.repo
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/9/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/9/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/9/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
[mysql-cluster-8.0-community]
name=MySQL Cluster 8.0 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/9/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
3. repository 확인
# yum repolist enabled | grep mysql
mysql-connectors-community MySQL Connectors Community
mysql-tools-community MySQL Tools Community
mysql80-community MySQL 8.0 Community Server
4. mysql install
# dnf install mysql-community-server
MySQL 8.0 Community Server 272 kB/s | 416 kB 00:01
MySQL Connectors Community 11 kB/s | 9.2 kB 00:00
MySQL Tools Community 74 kB/s | 119 kB 00:01
Dependencies resolved.
====================================================================================
Package Arch Version Repository Size
====================================================================================
Installing:
mysql-community-server aarch64 8.0.31-1.el9 mysql80-community 48 M
Installing dependencies:
groff-base aarch64 1.22.4-10.el9 baseos 1.0 M
libaio aarch64 0.3.111-13.el9 baseos 24 k
libtirpc aarch64 1.3.2-1.el9 baseos 92 k
mysql-community-client aarch64 8.0.31-1.el9 mysql80-community 3.9 M
mysql-community-client-plugins aarch64 8.0.31-1.el9 mysql80-community 1.3 M
mysql-community-common aarch64 8.0.31-1.el9 mysql80-community 538 k
mysql-community-icu-data-files aarch64 8.0.31-1.el9 mysql80-community 2.2 M
mysql-community-libs aarch64 8.0.31-1.el9 mysql80-community 1.5 M
ncurses aarch64 6.2-8.20210508.el9 baseos 400 k
numactl-libs aarch64 2.0.14-8.el9 baseos 30 k
perl-AutoLoader noarch 5.74-479.el9 appstream 30 k
perl-B aarch64 1.80-479.el9 appstream 188 k
perl-Carp noarch 1.50-460.el9 appstream 29 k
perl-Class-Struct noarch 0.66-479.el9 appstream 31 k
perl-Data-Dumper aarch64 2.174-462.el9 appstream 54 k
perl-Digest noarch 1.19-4.el9 appstream 25 k
perl-Digest-MD5 aarch64 2.58-4.el9 appstream 36 k
perl-Encode aarch64 4:3.08-462.el9 appstream 1.7 M
perl-Errno aarch64 1.30-479.el9 appstream 23 k
perl-Exporter noarch 5.74-461.el9 appstream 31 k
perl-Fcntl aarch64 1.13-479.el9 appstream 29 k
perl-File-Basename noarch 2.85-479.el9 appstream 26 k
perl-File-Path noarch 2.18-4.el9 appstream 35 k
perl-File-Temp noarch 1:0.231.100-4.el9 appstream 59 k
perl-File-stat noarch 1.09-479.el9 appstream 26 k
perl-FileHandle noarch 2.03-479.el9 appstream 24 k
perl-Getopt-Long noarch 1:2.52-4.el9 appstream 60 k
perl-Getopt-Std noarch 1.12-479.el9 appstream 24 k
perl-HTTP-Tiny noarch 0.076-460.el9 appstream 54 k
perl-IO aarch64 1.43-479.el9 appstream 95 k
perl-IO-Socket-IP noarch 0.41-5.el9 appstream 42 k
perl-IPC-Open3 noarch 1.21-479.el9 appstream 31 k
perl-MIME-Base64 aarch64 3.16-4.el9 appstream 30 k
perl-Net-SSLeay aarch64 1.92-1.el9 appstream 366 k
perl-POSIX aarch64 1.94-479.el9 appstream 105 k
perl-PathTools aarch64 3.78-461.el9 appstream 85 k
perl-Pod-Escapes noarch 1:1.07-460.el9 appstream 20 k
perl-Pod-Perldoc noarch 3.28.01-461.el9 appstream 83 k
perl-Pod-Simple noarch 1:3.42-4.el9 appstream 215 k
perl-Pod-Usage noarch 4:2.01-4.el9 appstream 40 k
perl-Scalar-List-Utils aarch64 4:1.56-461.el9 appstream 70 k
perl-SelectSaver noarch 1.02-479.el9 appstream 20 k
perl-Socket aarch64 4:2.031-4.el9 appstream 54 k
perl-Storable aarch64 1:3.21-460.el9 appstream 93 k
perl-Symbol noarch 1.08-479.el9 appstream 23 k
perl-Term-ANSIColor noarch 5.01-461.el9 appstream 48 k
perl-Term-Cap noarch 1.17-460.el9 appstream 22 k
perl-Text-ParseWords noarch 3.30-460.el9 appstream 16 k
perl-Text-Tabs+Wrap noarch 2013.0523-460.el9 appstream 23 k
perl-Time-Local noarch 2:1.300-7.el9 appstream 33 k
perl-URI noarch 5.09-3.el9 appstream 108 k
perl-base noarch 2.27-479.el9 appstream 25 k
perl-constant noarch 1.33-461.el9 appstream 23 k
perl-if noarch 0.60.800-479.el9 appstream 23 k
perl-interpreter aarch64 4:5.32.1-479.el9 appstream 79 k
perl-libnet noarch 3.13-4.el9 appstream 125 k
perl-libs aarch64 4:5.32.1-479.el9 appstream 2.0 M
perl-mro aarch64 1.23-479.el9 appstream 36 k
perl-overload noarch 1.31-479.el9 appstream 54 k
perl-overloading noarch 0.02-479.el9 appstream 21 k
perl-parent noarch 1:0.238-460.el9 appstream 14 k
perl-podlators noarch 1:4.14-460.el9 appstream 111 k
perl-subs noarch 1.03-479.el9 appstream 20 k
perl-vars noarch 1.05-479.el9 appstream 22 k
procps-ng aarch64 3.3.17-5.el9_0 baseos 331 k
Installing weak dependencies:
perl-IO-Socket-SSL noarch 2.073-1.el9 appstream 217 k
perl-Mozilla-CA noarch 20200520-6.el9 appstream 12 k
perl-NDBM_File aarch64 1.15-479.el9 appstream 31 k
Transaction Summary
====================================================================================
Install 69 Packages
Total download size: 66 M
Installed size: 363 M
Is this ok [y/N]:
5. mysql 서비스 확인
# systemctl status mysqld
○ mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset>
Active: inactive (dead)
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
6. mysql 서비스 시작
# systemctl start mysqld
7. root 패스워드 확인
8.x 부터는 설치시 패스워드가 log 파일에 기록됩니다.
# grep 'temporary password' /var/log/mysqld.log
2022-11-15T04:40:51.720191Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: >aZJFwn(H5iV
해당 패스워드는 평문으로 나오므로 설치 후에 는 반드시 변경이 필요합니다. 변경하지 않는 경우 다른 명령어 입력시 아래의 에러가 발생합니다.
mysql> SELECT @@VERSION;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
8. root 패스워드 변경
# mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
'Database > MySQL' 카테고리의 다른 글
mysql 8.x - mysql_config_editor (0) | 2022.11.16 |
---|---|
mysql 8.x 관련 스크립트 파일 (0) | 2022.11.16 |
docker mysql lower_case_table_names (0) | 2021.08.23 |
mysql 8.x error message (0) | 2021.08.15 |
mysql 8.x root password 초기화 (0) | 2021.08.15 |