Rocky Linux / MariaDB 설치하는 방법
MariaDB 설치
- MariaDB 설치
# dnf install mariadb-server
- 서비스 시작
# systemctl start mariadb
- 시스템 부팅 시 자동 시작되도록 설정
# systemctl enable mariadb
보안 설정
- root 비밀번호, 익명 사용자 제거, 원격 root 접속 차단, 테스트 DB 삭제 설정
# mysql_secure_installation
- 접속
# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 26 Server version: 10.5.29-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)]>
외부에서 접속 가능하게 설정
아래는 방화벽 설정입니다. 외부 접속 가능한 사용자 계정이 필요합니다.
- 3306 포트 허용
# firewall-cmd --permanent --add-port=3306/tcp
- 방화벽 다시 로드
# firewall-cmd --reload