Connect MySQL from Remote CentOS7

I just Installed CentOS7 and faced some issues in installing and connecting MySQL from remote location.

I used to do a yum install mysql-server, which is no more supported and for that I have to install mysql repo rpm first. i will write that some other time,

login to centos7 box with root and disable the firewall and flush iptables and disable iptables.

It is strongly not recommended that you stop firewall and iptables, I am just doing for my test purposes. you MUST configure firewall and iptables to allow MySQL incoming connection.


systemctl stop firewalld
systemctl disable firewalld
iptables -F
service iptables save

mysql-uroot -p 'YOUR_MYSQL_ROOT_PASSWORD'

MYSQL>CREATE USER 'root'@'%' IDENTIFIED BY 'Cro@t!a';
MYSQL>GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;
MYSQL>flush privileges;

 

1 thought on “Connect MySQL from Remote CentOS7

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.