Yum을 사용하여 CentOS, RHEL 7/6에 MariaDB 5.5를 설치하는 방법

Yum을 사용하여 CentOS, RHEL 7/6에 MariaDB 5.5를 설치하는 방법

2022-10-18 last update

5 minutes reading Install setup mariadb
MariaDB MySQL을 위한 향상된 드롭인 대체품. MariaDB는 강력하고 확장 가능하며 안정적인 SQL 서버를 찾는 데이터베이스 전문가에게 더 나은 선택이 될 수 있습니다. MariaDB에는 MySQL에 비해 업데이트된 기능이 많이 있습니다. 아래 링크를 사용하여 MariaDB와 MySQL 간의 기능 비교를 읽으십시오Features of MariaDB vs MySQL .
Compatibility between MariaDB vs MySQL
Read more about MariaDB 이 기사는 Yum을 사용하여 CentOS, RHEL 6/5 및 Fedora 19/18/17 시스템에 MariaDB 5.5를 설치하는 데 도움이 됩니다.

1단계: MariaDB Yum 리포지토리 추가

먼저 시스템에 MariaDB yum 저장소를 추가해야 합니다. 아래는 저장소 목록입니다. 시스템에 새 리포지토리 파일/etc/yum.repos.d/mariadb.repo를 만들고 운영 체제 및 아키텍처에 따라 주어진 코드를 추가합니다. CentOS/RHEL 7(64비트)
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/rhel7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
의 경우 CentOS/RHEL 6( 64 Bit)
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/rhel6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2단계: MariaDB 설치

다음 명령을 사용하여 시스템에 MariaDB를 설치합니다.
yum install MariaDB-server MariaDB-client

3단계: MariaDB 서비스 시작

시스템에 MariaDB를 설치한 후 다음 명령을 사용하여 서비스를 시작합니다.
service mysql start

4단계: MariaDB 설치 보안

마지막으로 MariaDB 설치를 암호로 보호하고 다른 변경 작업을 수행해야 합니다. 이렇게 하려면 명령줄에서 보안 설치 스크립트를 실행하십시오.
mysql_secure_installation
보안 설치 스크립트는 일부 지점에서 사용자 입력을 요청하고 아래 출력에 따라 설치를 따르십시오. 모든 사용자 입력은 빨간색으로 강조 표시됩니다.
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

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
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): [Press Enter]
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: [Enter Password Here]
Re-enter new password: [Re-enter Password Here]
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
 ... 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
 ... 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
 - 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
 ... 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!

5단계: 연결 확인

MariaDB를 설치한 후 다음 명령을 사용하여 mariadb 서버에 연결합니다
 mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 9
Server version: 5.5.34-MariaDB MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]>
웹 인터페이스를 사용하여 MariaDB를 관리할 수도 있습니다install phpMyAdmin. 이는 쉬운 작업 방법을 제공합니다.