Maria DB 설치 방법에 대한 가이드 포스트이다.
이 포스트는 ‘ThinkGround Project#1‘의 일환으로 GCP에 Cent OS 이미지의 VM Instance를 생성하여 진행하고 있다.

이전 포스트(GCP VM Instance(Cent-OS) 기본 세팅하기)를 참고한 분들이라면 이미 yum update를 했을 것이니 여기서는 패스하도록 하겠다.

# vim /etc/yum.repos.d/MariaDB.repo
위 command를 입력하여 하기 cat으로 출력한 내용에 대해 입력할 수 있도록 하자. vim editer에 대해서 잘 모르는 분들이라면 타 포스트를 참고하면 기본적인 것들은 쉽게 사용할 수 있다. i를 눌러서 ‘insert’모드에 돌입하여 위 내용을 입력해주면 되고, 입력이 끝났으면 esc를 눌러 다시 ‘command’ 모드로 변경 후, ‘:wq’를 입력 후 enter를 눌러 빠져나오면 된다.

# yum install -y mariadb mariadb-server
그 후에 yum을 통해 Maria DB 를 설치해준다. 여기서 -y는 이후 물어보는 질문에 대해 yes처리를 하겠다는 뜻이다. 그럼 자동으로 설치가 된다. 만약 여기서 설치가 제대로 되지 않는다면, yum update가 안되어있는 경우가 많으니 다시 확인해보는 것을 추천한다.

# systemctl start mariadb
설치가 완료된 후 mariadb를 실행하는 커맨드이다.



# mysql_secure_installation
그 이후 보안설정을 해줘야 한다. 위에 캡쳐를 해두었으니 참고해서 진행하면 될 듯하다.

# systemctl enable mariadb
위 command를 통해 mariadb가 자동실행되게끔 설정해두면 기본 세팅은 끝난다.