본문 바로가기

OS/Linux

mysql or mariadb 원격접속

반응형

1. mysql 원격 아이디 생성

msyql -> grant all privileges on *.* to 'yk'@'%'; 

mysql -> flush privileges;

vim /etc/my.cnf

bind-address = 127.0.0.1 -> 0.0.0.0 수정

netstat -ntlp | grep mysqld

firewall 사용하고 있으면 firewall-cmd --zone=public --add-port=3306/tcp --permanent

firewall-cmd --reload

firewall-cmd --list-ports

 

iptables -I INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT

 

 

반응형