CentOS 8에 MySQL 8.0 설치(AppStream)

CentOS 8에 MySQL 8.0 설치(AppStream)

2022-10-05 last update

6 minutes reading centos8 MySQL appstream

소개



Application Stream (AppStream)을 사용하여 CentOS8에 MySQL8.0 설치
상위 기사 : MySQL, MariaDB의 각종 인스톨 방법과 EOL 정리 - Qiita
참고 : RHEL8 패키지 구성 - BaseOS 및 Application Stream - 적모 엔지니어 블로그

지원



본 방법으로 도입한 경우, Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portal 보다, 2023-04가 EOL이라고 생각된다.
그 이후에 보고된 취약성이나 결함에 대한 대응은 실시되지 않을 가능성이 있다.
덧붙여 CentOS Linux 8가 2021-12에 EOL을 맞이하기 때문에, 그 이후의 갱신을 받기 위해서는 CentOS Stream8을 포함한 다른 디스트리뷰션으로의 이행이 필요.

LOG



설치


# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)

# yum install -y @mysql:8.0
... 略

mysql 시작/정지


# systemctl start mysqld
# systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-09-26 07:53:41 EDT; 13s ago
  Process: 2222 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
  Process: 2098 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
  Process: 2073 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 2180 (mysqld)
   Status: "SERVER_OPERATING"
    Tasks: 38 (limit: 11109)
   Memory: 487.8M
   CGroup: /system.slice/mysqld.service
           mq2180 /usr/libexec/mysqld --basedir=/usr

Sep 26 07:53:24 localhost.localdomain systemd[1]: Starting MySQL 8.0 database server...
Sep 26 07:53:24 localhost.localdomain mysql-prepare-db-dir[2098]: Initializing MySQL database
Sep 26 07:53:41 localhost.localdomain systemd[1]: Started MySQL 8.0 database server.
# systemctl stop mysqld
# systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

Sep 26 07:53:24 localhost.localdomain systemd[1]: Starting MySQL 8.0 database server...
Sep 26 07:53:24 localhost.localdomain mysql-prepare-db-dir[2098]: Initializing MySQL database
Sep 26 07:53:41 localhost.localdomain systemd[1]: Started MySQL 8.0 database server.
Sep 26 07:54:25 localhost.localdomain systemd[1]: Stopping MySQL 8.0 database server...
Sep 26 07:54:27 localhost.localdomain systemd[1]: Stopped MySQL 8.0 database server.

mysql 자동 시작 설정 / 설정 해제


# systemctl enable mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.

# systemctl list-unit-files --type=service |grep mysql
mysqld.service                              enabled
[email protected]                             disabled
# systemctl disable mysqld
Removed /etc/systemd/system/multi-user.target.wants/mysqld.service.

# systemctl list-unit-files --type=service |grep mysql
mysqld.service                              disabled
[email protected]                             disabled

각종 확인


# which mysql
/usr/bin/mysql

# which mysqld
/usr/sbin/mysqld

# systemctl start mysqld
# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.13 Source distribution

Copyright (c) 2000, 2018, 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.13    |
+-----------+
1 row in set (0.00 sec)