RHEL9 Yum(dnf)으로 최신버젼의 MariaDB를 설치하는 방법
최신버젼의 MariaDB를 설치하기 위한 Repository 자동설치 커맨드를 실행
# curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
- 기타 버젼의 설치를 위한 개별 repository설정은 여기서 확인 가능
MariaDB 설치
# dnf --enablerepo=mariadb install MariaDB-server
MariaDB 재부팅시 자동시작 설정 및 서비스 기동
# systemctl start mariadb
# systemctl enable mariadb
MariaDB 초기설정
# 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): <-- 「Enter」키 입력
OK, successfully used password, moving on...
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] y <-- 「y」을 입력
... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y <-- 「y」를 입력
New password: <-- 설정을 희망하는 패스워드를 입력(MariaDB의 root패스워드)
Re-enter new password: <-- 패스워드의 확인을 위한 재입력
Password updated successfully!
Reloading privilege tables..
... Success!
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 <-- 「y」를 입력
... Success!
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] y <-- 「y」를 입력
... Success!
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] y <-- 「y」를 입력
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y <-- 「y」를 입력
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
UTF8mb4 설정
- config 파일 백업
# cd /etc/my.cnf.d # cp -p server.cnf server.cnf_`date +%Y%m%d_%H%M%S`
- config 파일 수정
# vim server.cnf [mysqld] character-set-server = utf8mb4 [client-mariadb] default-character-set = utf8mb4
적당한 위치에 위 내용을 추가
MariaDB를 재기동하여 변경된 설정을 반영
# systemctl restart mariadb
댓글남기기