일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- Servlet
- 스프링 처음
- 톰캣 설치
- iftop
- jsp 배우기
- 트래픽 제한
- 초과 트래픽
- 스프링 프로젝트
- 트래픽
- 초과트래픽
- 파워목업
- Spring
- power mockup
- 스프링 시작하기
- 스프링
- error
- 트래픽제한
- 권한관리
- 스프링 시큐리티
- jsp project
- shaping
- home.jsp
- jsp 처음
- jdk 설치
- JSP
- HeidiSQL
- 트래픽 요금
- 트래픽요금
- 스프링시큐리티
- Traffic
- Today
- Total
이니미니
mysql linux서버 외부접속 본문
Mysql 외부 접속 방법
(버전별로 상세설정이 다를 수 있음)
1. Mysql 환경설정 확인
console 에서 mysql 접속 : mysql 버전 확인
eenymeeny@eenymeenyminymoe:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.19-0ubuntu0.16.04.1 (Ubuntu)
host에 localhost 는 내부접속권한(Default) , %는 외부 접속 권한 표시
mysql> use mysql;
Database changed
mysql> select host,user from user;
| host | user |
+-----------+-----------------+
| % | eenymeeny |
| localhost | debian-sys-maint |
| localhost | eenymeeny |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
2. 권한 설정
특정 IP만 접근
mysql> grant all privileges on *.* to ‘eenymeeny’@‘host’ identified by ‘password’;
특정 IP 대역 접근
mysql> grant all privileges on *.* to ‘eenymeeny’@‘0.0.0.%’ identified by ‘password’;
모든 IP 접근
mysql> grant all privileges on *.* to ‘eenymeeny’@‘%’ identified by ‘password’
3. 적용 후 확인
mysql>flush privileges;
mysql>select host,user from user;
외부접속시 에러 )
Can't connect to MySQL server on '서버아이피'(10061)
4. my.cnf 또는 mysqld.cnf 에서 외부 접속 관련 내용 변경하기
mysql 5.7 버전인 경우 mysqld.cnf 파일의 내용변경
sudo vi /etc/mysql/conf.d/mysqld.cnf
bind-address =127.0.0.1 부분 주석 처리
일부 mysql 버전은 my.cnf 파일의 내용을 변경
5. mysql 재시작
sudo /etc/init.d/mysql restart
'linux&server > issue' 카테고리의 다른 글
traffic shaping(트래픽제한) (0) | 2019.11.22 |
---|---|
iftop 트래픽 모니터링 / ubuntu (0) | 2019.11.22 |