728x90
Rocky mariadb 설치
MariaDB 설치
sudo dnf install mariadb-server mariadb -y
안될시 아래 진행후 재설치
sudo dnf install boost boost-devel -y
sudo yum install -y openssl-devel
시작
sudo systemctl start mariadb
시스템 시작 등록
sudo systemctl enable mariadb
초기셋팅 명령어
sudo mysql_secure_installation
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):
MariaDB의 보안을 설정하려면 root 사용자 계정의 현재 비밀번호가 필요합니다.
만약 방금 MariaDB를 설치했으며 아직 root 비밀번호를 설정하지 않았다면, 그냥 Enter 키를 눌러 계속 진행하세요.
[엔터]
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]
root 비밀번호를 설정하거나 unix_socket 인증 방식을 사용하면
적절한 인증 없이 아무도 MariaDB의 **root 사용자로 로그인할 수 없도록 보안이 강화됩니다.
현재 이미 root 계정이 보호되어 있으므로, 'n'을 선택해도 안전합니다.
[n]
Change the root password? [Y/n]
root 비밀번호를 변경하시겠습니까?
[y]
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]
기본적으로 MariaDB는 익명 사용자(anonymous user) 계정을 포함하고 있습니다.
이를 통해 사용자 계정을 생성하지 않아도 누구나 MariaDB에 로그인할 수 있습니다.
이 기능은 테스트 목적으로 제공되며, 설치를 보다 쉽게 진행하기 위한 것입니다.
하지만 운영 환경(production environment)에서는 보안상 익명 사용자를 제거하는 것이 좋습니다.
[y]
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]
일반적으로 root 계정은 'localhost'에서만 접속할 수 있도록 제한하는 것이 안전합니다.
이렇게 하면 네트워크를 통해 누군가 root 비밀번호를 무작위로 추측하여 로그인하는 것을 방지할 수 있습니다.
(root 계정의 원격 로그인을 차단하시겠습니까? [Y/n])
[y]
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]
기본적으로 MariaDB에는 'test'라는 데이터베이스가 포함되어 있으며,
누구나 접근할 수 있습니다.
이 데이터베이스는 테스트 용도로 제공되지만,
운영 환경(production environment)에서는 보안상 제거하는 것이 좋습니다.
(테스트 데이터베이스와 그 접근 권한을 제거하시겠습니까? [Y/n])
[y]
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n]
(권한 테이블을 지금 다시 로드하시겠습니까? [Y/n])
[y]
외부접속 허용
sudo vi /etc/my.cnf.d/mariadb-server.cnf
bind-address=0.0.0.0 <<< 주석해제
재시작
sudo systemctl restart mariadb
728x90
'리눅스 헛다리 > Rocky9.5' 카테고리의 다른 글
Rocky nginx 설치 (0) | 2025.02.28 |
---|---|
Rocky php8.3설치 (0) | 2025.02.28 |
Rocky dnf 업데이트 (0) | 2025.02.28 |
VM Rocky 고정 ip (0) | 2025.02.28 |
selinux,firewalld 비활성화 (0) | 2025.02.28 |