CentOS 8에 MariaDB 10.3 설치(AppStream)

CentOS 8에 MariaDB 10.3 설치(AppStream)

2022-10-04 last update

8 minutes reading mariadb centos8 appstream

소개



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

지원



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

note


  • MySQL을 넣은 후/var/lib/mysql을 삭제하고 나서 설치하지 않으면 부팅에 실패했습니다.

    LOG



    설치


    # cat /etc/redhat-release
    CentOS Linux release 8.0.1905 (Core)
    
    # yum install -y @mariadb:10.3
    ... 略
    

    mariadb 시작/정지


    # systemctl start mariadb
    # systemctl status mariadb
    ● mariadb.service - MariaDB 10.3 database server
       Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
       Active: active (running) since Thu 2019-09-26 08:16:46 EDT; 32s ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 8691 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
      Process: 8558 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
      Process: 8533 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
     Main PID: 8659 (mysqld)
       Status: "Taking your SQL requests now..."
        Tasks: 30 (limit: 11109)
       Memory: 82.8M
       CGroup: /system.slice/mariadb.service
               mq8659 /usr/libexec/mysqld --basedir=/usr
    
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: Please report any problems at http://mariadb.org/jira
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: The latest information about MariaDB is available at http://mariadb.org/.
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: You can find additional information about the MySQL part at:
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: http://dev.mysql.com
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: Consider joining MariaDB's strong and vibrant community:
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: https://mariadb.org/get-involved/
    Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26  8:16:46 0 [Note] /usr/libexec/mysqld (mysqld 10.3.11-MariaDB) starting as process 8659 ...
    Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26  8:16:46 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4184)
    Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26  8:16:46 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
    Sep 26 08:16:46 localhost.localdomain systemd[1]: Started MariaDB 10.3 database server.
    
    # systemctl stop mariadb
    # systemctl status mariadb
    ● mariadb.service - MariaDB 10.3 database server
       Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
       Active: inactive (dead)
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
    
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: You can find additional information about the MySQL part at:
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: http://dev.mysql.com
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: Consider joining MariaDB's strong and vibrant community:
    Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: https://mariadb.org/get-involved/
    Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26  8:16:46 0 [Note] /usr/libexec/mysqld (mysqld 10.3.11-MariaDB) starting as process 8659 ...
    Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26  8:16:46 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4184)
    Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26  8:16:46 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
    Sep 26 08:16:46 localhost.localdomain systemd[1]: Started MariaDB 10.3 database server.
    Sep 26 08:18:03 localhost.localdomain systemd[1]: Stopping MariaDB 10.3 database server...
    Sep 26 08:18:05 localhost.localdomain systemd[1]: Stopped MariaDB 10.3 database server.
    

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


    # systemctl enable mariadb
    Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
    Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
    Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
    
    # systemctl list-unit-files --type=service |grep maria
    mariadb.service                             enabled
    [email protected]                            disabled
    
    # systemctl disable mariadb
    Removed /etc/systemd/system/multi-user.target.wants/mariadb.service.
    Removed /etc/systemd/system/mysql.service.
    Removed /etc/systemd/system/mysqld.service.
    
    # systemctl list-unit-files --type=service |grep maria
    mariadb.service                             disabled
    [email protected]                            disabled
    

    각종 확인


    # which mysql
    /usr/bin/mysql
    
    # systemctl start mariadb
    # mysql -u root
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 8
    Server version: 10.3.11-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> select version();
    +-----------------+
    | version()       |
    +-----------------+
    | 10.3.11-MariaDB |
    +-----------------+
    1 row in set (0.001 sec)