1. mariadb 설치

- # yum install mariadb


2. mariadb-server 설치

- # yum install mariadb-server


3. 설정파일 복사

- # cp /usr/share/mysql/my-medium.cnf /etc/my.cnf


4. 설정 추가

- # vi /etc/my.cnf

[mysqld]


character-set-server=utf8

collation-server=utf8_general_ci

lower_case_table_names = 2


SET PASSWORD FOR root@localhost=PASSWORD(‘패스워드’);


5. 부팅시 자동실행 설정 및 MariaDB 실행

- # systemctl enable mariadb

  # systemctl start mariadb


6. 방화벽 설정

- # firewall-cmd --permanent --zone=public --add-port=3306/tcp

  # firewall-cmd --reload


7. root 계정 접속

- # mysql -u root -p


8. 데이터베이스 생성

- MariaDB > create database LJO001


9. 유저 생성 및 권한 부여

- MariaDB > create user 'user1'@'%' identified by 'user_pw'; 

  MariaDB > grant all privileges on *.* to 'user1'@'%' with grant option;

  MariaDB > grant all privileges on *.* to 'user1'@'localhost' identified by 'user_pw' with grant option; 

  MariaDB > show global variables like 'log_bin_trust_function_creators'; 

  MariaDB > SET GLOBAL log_bin_trust_function_creators = 1;    //Function 생성권한



'서버설정 및 설치 > DB' 카테고리의 다른 글

centos mongodb 설치 및 샤딩  (0) 2020.11.24
Redis 설치  (0) 2018.07.11
MongoDB 설치  (0) 2018.07.11