tech/linux

21/07/14 Centos 7 MariaDB 설치 및 실행 명령

tech-lover 2021. 7. 14. 11:29

1. MariaDB 설치

$ yum install -y mariadb-server

 

2. 실행 방법

- 시스템 부팅시 자동 시작

$ systemctl start mariadb

- mariadb 실행

$ systemctl start mariadb

- mariadb 상태 확인

$ systemctl status mariadb

 

3. Mariadb 접속 방법

- root 계정 비밀번호 생성

$ mysqladmin password mypassword(영문+숫자 특수문자 안됨)

$ mysql -u root mypassword

  > UPDATE user SET password=password('mypassword') WHERE user='root'

  > FLUSH PRIVILEGES;

 

- mariadb 접속 (root 계정)

$ mysql -u root -p