Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...


설치

  1. 먼저 시스템을 업데이트합니다.

    Code Block
    sudo yum  -y update
  2. Package 로 설치하기 위해 mariadb 저장소 정보를 추가합니다

    Code Block
    sudo tee /etc/yum.repos.d/MariaDB.repo<<EOF 
    
    [mariadb]
    name = MariaDB
    baseurl = http://yum.mariadb.org/10.4/centos7-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1
    EOF
  3. mariadb 저장소를 업데이트합니다.

    Code Block
    sudo yum makecache fast
  4. MariaDB 패키지 설치합니다.

    Code Block
    sudo yum -y install MariaDB-server MariaDB-client
  5. 부팅시 자동으로 구동되도록 설정합니다.

    Code Block
    sudo systemctl enable mariadb
  6. 이제 mariadb 서비스를 시작합니다.

    Code Block
    sudo systemctl restart mariadb

DBMS 설정

  1. 설정 스크립트를 시작합니다.

    Code Block
     sudo mysql_secure_installation
  2. root 암호를 설정합니다.

    Code Block
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    
    In order to log into MariaDB to secure it, we'll need the current
    password for the root user. If you've just installed MariaDB, and
    haven't set the root password yet, you should just press enter here.
    
    Enter current password for root (enter for none): 
    
    
  3. 권한있는 이만 접속할수 있도록 unix_socket 을 사용하도록 설정합니다.

    Code Block
    Setting the root password or using the unix_socket ensures that nobody
    can log into the MariaDB root user without the proper authorisation.
    
    You already have your root account protected, so you can safely answer 'n'.
    
    Switch to unix_socket authentication [Y/n] 
    
    
  4. 1111

    Code Block
    Reloading privilege tables..
     ... Success!
    
    
    You already have your root account protected, so you can safely answer 'n'.
    
    Change the root password? [Y/n] 
    
    
  5. 익명 사용자를 삭제합니다.

    Code Block
    By default, a MariaDB installation has an anonymous user, allowing anyone
    to log into MariaDB without having to have a user account created for
    them.  This is intended only for testing, and to make the installation
    go a bit smoother.  You should remove them before moving into a
    production environment.
    
    Remove anonymous users? [Y/n] y
     ... Success!
    
    
  6. root 사용자는 원격에서 접속하지 못하도록 설정합니다.

    Code Block
    Normally, root should only be allowed to connect from 'localhost'.  This
    ensures that someone cannot guess at the root password from the network.
    
    Disallow root login remotely? [Y/n] 
    
    
  7. test 용 DB 를 삭제합니다.

    Code Block
    By default, MariaDB comes with a database named 'test' that anyone can
    access.  This is also intended only for testing, and should be removed
    before moving into a production environment.
    
    Remove test database and access to it? [Y/n] 
    
  8. 변경 사항을 반영하기 위해 privilege 테이블을 다시 로딩하면 설정이 끝납니다.

    Code Block
    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.
    
    Reload privilege tables now? [Y/n] 
    
    
  9. 11이제 root 사용자로 연결해서 테스트해 보면 됩니다.


같이 보기

Ref