2015년 11월 1일 일요일

CeotOS mariaDB설치

1. maria-DB repo 추가
https://downloads.mariadb.org/mariadb/repositories/

# MariaDB 5.5 CentOS repository list - created 2015-08-06 01:33 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

vi /etc/yum.repos.d/MariaDB.repo


2. 기존 mysql 삭제
service mysqld stop
yum -y remove mysql-server mysql

3. Maria-DB 설치
yum -y install mysql-server mysql
yum -y install mysql-devel
service mysql start
mysql_upgrade
mysql

4. 비밀번호 설정(비번이 123456 일때)
/usr/bin/mysqladmin -u root password 123456

4-1. 이미정한 비번을 다시 바꿀때
/usr/bin/mysqladmin -u root -p password 654321
Enter password: 123456(엔터)

5. 포트확인
netstat -anp | grep 3306

6. 부팅시 자동시작 확인(default 가 자동시작)
chkconfig mysql on
chkconfig --list mysql
mysql           0:off 1:off 2:on 3:on 4:on 5:on 6:off

7. 접속 시도(비번이 123456 일때)
mysql -uroot -p123456

8. 외부 접속 허용 (모든 아이피에 대해서)
MariaDB [(none)]> grant all privileges on {데이터베이스명}.* to {아이디}@'%' identified by '{패스워드}' with grant option;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

댓글 없음:

댓글 쓰기