mariaDB 설치 관련 정리 - CentOS
1.1. 확인
# rpm -qa | grep MariaDB
# rpm -qa | grep MariaDB
1.2. 저장소 추가
# vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
1.3. mariaDB 서버 설치
# yum install mariadb-*
서버가 설치가 안되었을 경우
# yum install MariaDB-server
# yum install mariadb-*
서버가 설치가 안되었을 경우
# yum install MariaDB-server
1.4. 서버 설정(server.cnf) 변경
# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
1.5. UTF-8 및 max_allowed_packet 설정
/etc/my.cnf 에서 서버 설정부분에다가 추가.
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
max_allowed_packet=1073741824
/etc/my.cnf 에서 서버 설정부분에다가 추가.
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
max_allowed_packet=1073741824
1.6. mariadb 서버 시작
# service mariadb start
또는 # /etc/init.d/mysql start
# service mariadb start
또는 # /etc/init.d/mysql start
1.7. root 패스워드 변경
# mysqladmin password
또는 # /usr/bin/mysqladmin -u root password 'P@ssw0rd'
# mysqladmin password
또는 # /usr/bin/mysqladmin -u root password 'P@ssw0rd'
1.8. DB 생성 및 사용자 추가
# mysql -uroot –p
MariaDB [(none)]> create database taps;
Query OK, 1 row affected (0.05 sec)
MariaDB [(none)]> create user 'locu'@'%' identified by '!dlatluser1';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create user 'locu'@'localhost' identified by '!dlatluser1';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on taps.* to 'locu'@'%';
Query OK, 0 rows affected (0.02 sec)
MariaDB [(none)]> grant all privileges on taps.* to 'locu'@'localhost';
Query OK, 0 rows affected (0.00 sec)
※ root 사용자를 외부에서 모든 DB 에 접근가능하게 하기 위해서는 다음 쿼리문을 실행
MariaDB [mysql]> grant all privileges on *.* to 'root'@'%' identified by '!dlatluser1';
# mysql -uroot –p
MariaDB [(none)]> create database taps;
Query OK, 1 row affected (0.05 sec)
MariaDB [(none)]> create user 'locu'@'%' identified by '!dlatluser1';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> create user 'locu'@'localhost' identified by '!dlatluser1';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on taps.* to 'locu'@'%';
Query OK, 0 rows affected (0.02 sec)
MariaDB [(none)]> grant all privileges on taps.* to 'locu'@'localhost';
Query OK, 0 rows affected (0.00 sec)
※ root 사용자를 외부에서 모든 DB 에 접근가능하게 하기 위해서는 다음 쿼리문을 실행
MariaDB [mysql]> grant all privileges on *.* to 'root'@'%' identified by '!dlatluser1';
# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
또는 # chkconfig mysql on
# chkconfig --list mysql
댓글
댓글 쓰기