본문 바로가기
다른 DBMS/MySQL&MariaDB

MYSQL설치(RPM)

by 취미툰 2020. 12. 3.
반응형

 

사용 Software

제품명

버전

아키텍쳐

Oracle VirtualBox

5.2.22

X86_64bit

 

서버 정보

OS

DB

MEMORY

Oracle Linux 7.5

MySQL 8.0.19

2048MB

 

2.RPM 설치

Yum 설치와 설치방법이 동일하며 Yum설치가 자동으로 설치해준다면 RPM 설치는 그 파일을 수동으로 설치한다는 차이가 있습니다.

 

설치파일 사이트

https://dev.mysql.com/downloads/mysql/

에서 OS에 맞는 OS 버전 선택 후 RPM Bundle 다운로드 클릭하여 다운받습니다.

 

1.SELINUX 끄기

아래 내용을 추가해서 SELINUX의 사용을 멈춥니다.

# vi /etc/selinux/config

SELINUX=disabled

 

 

2.RPM bundle파일의 압축을 풀어줍니다

#tar xvf mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar

mysql-community-client-8.0.19-1.el7.x86_64.rpm

mysql-community-server-8.0.19-1.el7.x86_64.rpm

mysql-community-test-8.0.19-1.el7.x86_64.rpm

mysql-community-common-8.0.19-1.el7.x86_64.rpm

mysql-community-embedded-compat-8.0.19-1.el7.x86_64.rpm

mysql-community-devel-8.0.19-1.el7.x86_64.rpm

mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm

mysql-community-libs-8.0.19-1.el7.x86_64.rpm

 

 ----------------------------------------------------------------------------------------------------------------------------------

**RPM 설치 시 아래와 같이 MariaDB-libs RPM과 충돌메세지가 발생하면 기존에 설치된 MariaDB-libs를 삭제 후 진행합니다.

 

# rpm -ivh mysql-community-libs-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-libs-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signat                    ure, key ID 5072e1f5: NOKEY

error: Failed dependencies:

        mysql-community-common(x86-64) >= 8.0.11 is needed by mysql-community-li                    bs-8.0.19-1.el7.x86_64

        mariadb-libs is obsoleted by mysql-community-libs-8.0.19-1.el7.x86_64

---------------------------------------------------------------------------------------------------------------------------------- 

 

# rpm -qa |grep mariadb

mariadb-libs-5.5.60-1.el7_5.x86_64

# yum -y remove mariadb-libs

Loaded plugins: langpacks, ulninfo

Resolving Dependencies

--> Running transaction check

---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be erased

--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64

--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64

--> Running transaction check

---> Package postfix.x86_64 2:2.10.1-7.el7 will be erased

생략

Removed:

  mariadb-libs.x86_64 1:5.5.60-1.el7_5

 

Dependency Removed:

  postfix.x86_64 2:2.10.1-7.el7

 

Complete!

 

 

3.RPM 설치 진행

mysql-community-test-8.0.19-1.el7.x86_64.rpm를 제외하고 RPM설치를 진행합니다.

 

#rpm -ivh mysql-community-common-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-common-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-common-8.0.19-1.e################################# [100%]

[root@localhost tmp]# rpm -ivh mysql-community-libs-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-libs-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-libs-8.0.19-1.el7################################# [100%]

# rpm -ivh mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-libs-compat-8.0.1################################# [100%]

[root@localhost tmp]# rpm -ivh mysql-community-devel-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-devel-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

error: Failed dependencies:

        pkgconfig(openssl) is needed by mysql-community-devel-8.0.19-1.el7.x86_64

 

# rpm -ivh mysql-community-embedded-compat-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-embedded-compat-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-embedded-compat-8################################# [100%]

[root@localhost tmp]# rpm -ivh mysql-community-devel-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-devel-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

error: Failed dependencies:

        pkgconfig(openssl) is needed by mysql-community-devel-8.0.19-1.el7.x86_64

 

dependencies failed에러 발생시 --nodeps --force옵션을 사용하여 강제설치합니다.

# rpm -ivh mysql-community-devel-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-devel-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

error: Failed dependencies:

        pkgconfig(openssl) is needed by mysql-community-devel-8.0.19-1.el7.x86_64

# rpm -ivh mysql-community-devel-8.0.19-1.el7.x86_64.rpm --nodeps --force

warning: mysql-community-devel-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-devel-8.0.19-1.el################################# [100%]

[root@localhost tmp]# rpm -ivh mysql-community-client-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-client-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-client-8.0.19-1.e################################# [100%]

[root@localhost tmp]# rpm -ivh mysql-community-server-8.0.19-1.el7.x86_64.rpm

warning: mysql-community-server-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql-community-server-8.0.19-1.e################################# [100%]

 

 

4.최초 MYSQL 생성 후 비밀번호 변경

# ./mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql  

 

   2020-05-06T08:12:16.832075Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.

2020-05-06T08:13:49.871073Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.19) initializing of server in progress as process 4449

2020-05-06T08:13:59.238734Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: qf?IU9tgdOep

 

#mysql -u root -p

Enter password: qf?IU9tgdOep

 

RPM 설치 시 임시비밀번호가 발급되고 반드시 최초접속 후 변경해줘야 합니다.

 

mysql> alter user 'root'@'localhost' identified by 'oracle';

Query OK, 0 rows affected (0.01 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)

 

mysql> exit

Bye

# mysql -u root -p

Enter password: oracle

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 9

Server version: 8.0.19 MySQL Community Server - GPL

 

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql> select version();

+-----------+

| version() |

+-----------+

| 8.0.19    |

+-----------+

1 row in set (0.00 sec)

반응형

'다른 DBMS > MySQL&MariaDB' 카테고리의 다른 글

시스템 변수 변경방법  (0) 2020.12.08
MYSQL설치(바이너리)  (0) 2020.12.04
MYSQL 설치(YUM)  (0) 2020.12.02
Column Size 증가시 테스트  (0) 2020.10.15
Galera_Cluster 구축하기  (0) 2020.02.06

댓글