리눅스는 Debian 리눅스를 기준으로 합니다.


/etc/mysql/my.cnf 파일수정


bind-address = 0.0.0.0


위 bind-address = 0.0.0.0 을 추가해줍시다.



사용자 작성, 권한 부여


# mysql -u root -p MariaDB [(none)]> create database etssun_db; // 데이터베이스 생성 MariaDB [(none)]> create user 'etssun'@'%' identified by 'root'; // etssun 이라는 계정을 비밀번호를 root로 생성 MariaDB [(none)]> grant all privileges on etssun_db.* to etssun@'%'; //etssun_db 라는 데이터베이스의 권한을 etssun 에게 줌 MariaDB [(none)]> flush privileges; // 설정 바로적용 # mysqladmin -u root -p reload # service mysql restart // 서비스 재시작


방화벽(Firewall) 설정


   # iptables -I INPUT 1 -p tcp --dport 3306 -j ACCEPT
   # iptables -I OUTPUT -p tcp --dport 3306 -j ACCEPT
   # iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT



클라이언트에서 정상적으로 접속되는지 확인


+ Recent posts