본문 바로가기
Database/Mysql

EC2에서 Mariadb 설치하기

by 화곡공룡 2020. 12. 14.
반응형

DB 설치

yum 패키지를 이용하여 mariadb를 설치한다.

yum 최신 update

$ sudo yum update

db install

$ sudo yum install mariadb-server

$ sudo yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
... 생략
Replaced:
  iwl7265-firmware.noarch 0:22.0.7.0-72.el7

Complete!
$
$ sudo yum install mariadb-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
base                                                                                                                                          | 3.6 kB  00:00:00
extras                                                                                                                                        | 2.9 kB  00:00:00
updates                                                                                                                                       | 2.9 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.65-1.el7 will be installed
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.65-1.el7.x86_64
... 생략
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                                     Arch                               Version                                       Repository                        Size
=====================================================================================================================================================================
Installing:
 mariadb-server                              x86_64                             1:5.5.65-1.el7                                base                              11 M
Installing for dependencies:
 libaio                                      x86_64                             0.3.109-13.el7                                base                              24 k
 perl-DBD-MySQL                              x86_64                             4.023-6.el7                                   base                             140 k
... 생략
Transaction Summary
=====================================================================================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 12 M
Installed size: 61 M
Is this ok [y/d/N]: y
Downloading packages:
(1/6): libaio-0.3.109-13.el7.x86_64.rpm                                                                                                       |  24 kB  00:00:00
(2/6): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm                                                                                                  | 140 kB  00:00:00
(3/6): perl-DBI-1.627-4.el7.x86_64.rpm                                                                                                        | 802 kB  00:00:00
(4/6): perl-Net-Daemon-0.48-5.el7.noarch.rpm                                                                                                  |  51 kB  00:00:00
(5/6): perl-PlRPC-0.2020-14.el7.noarch.rpm                                                                                                    |  36 kB  00:00:00
(6/6): mariadb-server-5.5.65-1.el7.x86_64.rpm                                                                                                 |  11 MB  00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                 37 MB/s |  12 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libaio-0.3.109-13.el7.x86_64                                                                                                                      1/6
... 생략                                                                                                                 4/6
Installed:
  mariadb-server.x86_64 1:5.5.65-1.el7

Dependency Installed:
  libaio.x86_64 0:0.3.109-13.el7           perl-DBD-MySQL.x86_64 0:4.023-6.el7        perl-DBI.x86_64 0:1.627-4.el7        perl-Net-Daemon.noarch 0:0.48-5.el7
  perl-PlRPC.noarch 0:0.2020-14.el7

Complete!
$        

서비스 실행

서비스 실행

$ sudo service mariadb start

서비스 중지

$ sudo service mariadb stop

서비스 상태 확인

$ sudo status mariadb start

process 확인

- mariadb의 프로세스 mysql 기반으로 만들어져 mysqld 데몬이 올라온다.

$ ps -ef | grep mysql | grep -v grep

$ sudo service mariadb start
Redirecting to /bin/systemctl start mariadb.service
$ 
$ service mariadb status
Redirecting to /bin/systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
... 생략
   CGroup: /system.slice/mariadb.service
           ├─24960 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─25122 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid...

Jul 23 09:39:16 ip-172-31-32-16.ap-northeast-2.compute.internal mariadb-prepare-db-dir[24876]: MySQL manual for more instructions.
Jul 23 09:39:16 ip-172-31-32-16.ap-northeast-2.compute.internal mariadb-prepare-db-dir[24876]: Please report any problems at http://mariadb.org/jira
Jul 23 09:39:16 ip-172-31-32-16.ap-northeast-2.compute.internal mariadb-prepare-db-dir[24876]: The latest information about MariaDB is available at http://mar...rg/.
... 생략
Jul 23 09:39:16 ip-172-31-32-16.ap-northeast-2.compute.internal mysqld_safe[24960]: 200723 09:39:16 mysqld_safe Starting mysqld daemon with databases from /.../mysql
Jul 23 09:39:18 ip-172-31-32-16.ap-northeast-2.compute.internal systemd[1]: Started MariaDB database server.
$
$ ps -ef | grep mysql | grep -v grep
mysql    24960     1  0 09:39 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql    25122 24960  1 09:39 ?        00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
$

root 패스워드 설정

초기 패스워드는 mysqladmin 명령으로 설정

$ mysqladmin -u root -p password 'Rootqaz!@34'

설정 된 DB 접속이 되는지 확인

$ mysql -u root -p

Database 확인

> show databases;

root 패스워드 설정

초기 패스워드는 mysqladmin 명령으로 설정

$ mysqladmin -u root -p password 'Rootqaz!@34'

​

설정 된 DB 접속이 되는지 확인

$ mysql -u root -p

​

Database 확인

> show databases;

반응형

'Database > Mysql' 카테고리의 다른 글

Mysql / Mariadb에서 쉘명령어 사용하기  (0) 2020.12.14
MariaDB Password 복잡도 설정  (6) 2020.12.14
mysql / mariadb grant 설정  (0) 2020.12.14
MariaDB Audit 설정하기  (0) 2020.12.14
mysql/mariadb Aborted connection 에러  (0) 2020.12.14

댓글