Database/MySQL
root 계정 외부 접근 권한 할당
editor2080
2018. 7. 3. 14:41
* Client OS IP: 192.168.0.22
* Server OS IP: 192.168.0.21
1. 권한이 허용되지 않은 상태에서 접근 시
2. Server Side
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.7.22-0ubuntu0.16.04.1 (Ubuntu) Copyright (c) 2000, 2018, 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> | cs |
3.
1 2 3 | mysql> grant all privileges on *.* to 'root'@'%' identified by '****'; Query OK, 0 rows affected, 1 warning (0.00 sec) | cs |
root : 외부 접속을 위한 권한을 허용할 계정
**** : 해당 계정의 비밀번호
4.
1 2 3 | mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) | cs |
5.
1 2 3 | mysql> exit Bye | cs |
6. Client Side
* 위와 같이 접속이 되지 않을 경우 mysql 설치 시 기본적으로 local 접속만 허용되도록 설정되어 있기 때문에 외부 허용 설정을 해주어야 합니다.