0

I have a windows server and I use laragon on my local machine and HeidiSql as an interface

What I want to achieve:

I want to connect from my computer to Windows server and connect to Mysql database.

What have I tried:

1.I have granted permissions to mysql user(on Windows server) to connect from anywhere using this: GRANT ALL PRIVILEGES ON *.* TO 'mysql_user'@'%' IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;

2.I have found my.ini file on Windows server and set bind-address = 0.0.0.0

3.I have made an Inbound rule on windows server firewall to allow port 3306

After all this I got an error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'XX.XX.XX.XX' (10060)

Still can`t connect.... I have googled for this for many hours and as far as I understand that this means that I am still not allowed to connect?

I have also tried to set bind-address=windows-server-IP on the Windows server itself as suggested on some forums.

I have really ran out of options. All forums suggests all the steps above but it just doesn`t work. Any help would be much appreciated.

Davis
  • 361
  • 1
  • 5
  • 19
  • 1
    open terminal in windows server and try login MySQL by specifying host IP .... 'mysql -u -p -h ' .. if you are able to log in, then the firewall is blocking the connections from outside. – jithin giri Feb 07 '19 at 05:38
  • Maybe an network problem? Proxy, firewall.., – Jens Feb 07 '19 at 05:40
  • @jithin girl This gives me back this error: ERROR 2002 (HY000): Can't connect to MySQL server on '213.175.117.185' (10060) – Davis Feb 07 '19 at 05:54
  • @Jens Can you tell me how to check that please? – Davis Feb 07 '19 at 05:55
  • so you are not able to connect from within that server itself by specifying host, then the reason is not the network or firewall issue, the reason may be either 1)error in grant privilege may be a typo in your password (it can be checked by try login without specifying host name ' mysql -u root -p' form the terminal ) or 2)improper setting bind address to 0.0.0.0 (check the variable value ' show global variables like '%bind%' ' ) – jithin giri Feb 07 '19 at 06:23
  • @jithin girl I can login with "mysql -u root -p" without any problems. I have set bind-address=0.0.0.0 in my.ini file under [mysqld]. How can I check those global variables? – Davis Feb 07 '19 at 06:30
  • set the bind-address=0.0.0.0 and restart mysql, then login mysql and execute this " show global variables like '%bind%' ; " – jithin giri Feb 07 '19 at 06:34
  • Its gives me back this: Empty set (0.00 sec) – Davis Feb 07 '19 at 06:46

1 Answers1

1

Before anyone else spends countless hours trying to figure this out I found a solution. It turns out it has nothing to do with user permissions and firewall. I had to allow port 3306 from host and only then it is about the permissions and firewall.

Davis
  • 361
  • 1
  • 5
  • 19