-1

I have already followed the following link to setup the MySQL server in CentOS 7. How to allow remote connection to mysql

However, by commenting out "bind-address = XXX.XXX.XXX.XXX" in /etc/my.cnf , it does not work at all. the mariadb cannot be restarted. systemctl restart mariadb

Should I work on firewall setting or somewhere else?

Community
  • 1
  • 1
tw123789
  • 55
  • 11

2 Answers2

0

You have to check the sql user permission. Each SQL user has a "scope". By default, all user are authorized from "localhost". You have to create a new SQL user with "%" as client.

Thibault Henry
  • 816
  • 6
  • 16
  • hi Thibault, Thanks for your reply. I know where is the problem. It is due to the firewall. Now, I tick the mysql service in public zone... Then I can connect to mysql server now. However, I don't know if this is a safe practice...ask for your comment. – tw123789 May 20 '15 at 10:21
  • If you have a good firewall, allow the MySQL connexion only for you distant IP, not for everyone. – Thibault Henry May 20 '15 at 10:24
  • Actually, I just allow my home IP to access the mariadb database in my office. I have set the privileges for that home IP only. Is it enough? – tw123789 May 20 '15 at 10:27
0

This is due to the firewall problem. I have tick the service mysql in the public zone in firewall setting. However, I don't know if this is a "safe" practice. Thanks.

tw123789
  • 55
  • 11