nickjoIT

AWS에 설치된 MySQL DB를 외부 접속이 가능 하도록 설정 본문

PROGRAMING/AWS

AWS에 설치된 MySQL DB를 외부 접속이 가능 하도록 설정

nickjo 2017. 10. 4. 14:52

AWS - Security Group 설정

Inbound 탭에서 3306 포트를 열고 Source는 Anywhere(0.0.0.0)으로 설정

MySQL 설정 파일(/etc/mysql/my.cnf) 수정

bind-address 항목을 찾아서 0.0.0.0으로 변경(이전 값은 127.0.0.1)

MySQL 재시작

service mysql restart

ROOT 계정으로 외부에서 접속 가능하게 하려면

아래의 명령을 MySQL monitor에서 실행

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.5.41-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'your password' WITH GRANT OPTION;
Query OK, 0 rows affected (0.12 sec)


[참고]


'PROGRAMING > AWS' 카테고리의 다른 글

centos7 FTP 설치  (0) 2018.08.15
Mac OS alias 설정  (0) 2018.08.15
prompt name change  (0) 2017.09.27
CentOS 7 서비스 관리  (0) 2017.08.27
우분투 Tomcat7에 WAR 배포 하기  (0) 2017.06.06
Comments