검색결과 리스트
글
본 내용은 다음과 같은 환경을 전제로 작성되었습니다.
MariaDB 5.5.37 (설치하고 나서 보니 MariaDB 5.5.41 로 설치가 되었다. 약간 업그레드 버전이군요. ^^)
CentOS release 7.0
2. MariaDB 설치
MariaDB를 위한 yum Repository 를 추가하기 위해 아래와 같이 "MariaDB.repo" 파일을 작성합니다.
# vi /etc/yum.repos.d/MariaDB.repo
"MariaDB.repo" 파일에 다음의 내용을 입력합니다.
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum을 이용하여 MariaDB-server와 MariaDB- client 를 설치합니다.
# yum install MariaDB-server MariaDB-client
설치된 MariaDB를 실행합니다.
# /etc/init.d/mysql start
3. root 패스워드와 외부 접속 설정
Mariadb root password 변경은 다음과 같이 진행합니다.
[admin@localhost ~]$ /usr/bin/mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.40-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [mysql]> update user set password=password('비밀번호') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> quit
Bye
MariaDB 재시작
# service mysql stop
# service mysql start
사용자 접속 정보 확인
[admin@localhost ~]$ /usr/bin/mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.40-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [mysql]> select user,host,password from user;
+------+-----------------------+-------------------------------------------+
user host password
+------+-----------------------+-------------------------------------------+
root localhost *889C926028E12783CDA5CF3FA3FAEDD7D98C2CB6
root localhost.localdomain *889C926028E12783CDA5CF3FA3FAEDD7D98C2CB6
root 127.0.0.1 *889C926028E12783CDA5CF3FA3FAEDD7D98C2CB6
root ::1 *889C926028E12783CDA5CF3FA3FAEDD7D98C2CB6
localhost
localhost.localdomain
+------+-----------------------+-------------------------------------------+
6 rows in set (0.00 sec)
외부에서 root 로그인
MariaDB [mysql]> grant all privileges on *.* to 'root'@'192.%' identified by '비밀번호' with grant option;
Query OK, 0 rows affected (0.01 sec)
[admin@localhost ~]$ /usr/bin/mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.40-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [mysql]> create database wordpress character set utf8 collate utf8_general_ci;
MariaDB [mysql]> CREATE USER 'wordpress'@'%' IDENTIFIED BY 'wordpress';
MariaDB [mysql]> grant all privileges on wordpress.* to 'wordpress'@'localhost' identified by 'wordpress' with grant option;
MariaDB [mysql]> flush privileges;
참고사항
MariaDB 프로그램 설치경로 : /usr/lib64/mysql
MariaDB 설정파일 경로 : /etc/my.cnf
'리눅스 > Centos' 카테고리의 다른 글
아파치 설치 (0) | 2017.11.02 |
---|---|
CentOS 7 Oracle 11G Release 2 (11.2) DB 설치 (0) | 2017.10.26 |
centos7 톰캣설치 (0) | 2017.10.12 |
centos7 재부팅후 명령어 (0) | 2017.10.12 |
RECENT COMMENT