0

I am not sure if I can ask this basic question here. But, I want to know if I can connect mysql server in LAN from another PC outside of LAN. Is it usually not possible, isn't it?

I have one PC in LAN that my office has in their LAN. And, I want to access to the mysql from my PC home for development purpose.

I tried the following commands on mysql server PC to create a user for accessing from outside and grant all privileges to it:

CREATE USER 'myName'@'myHomePcIpAddress' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'myName'@'myHomePcIpAddress' WITH GRANT OPTION;

and tried to access from home PC using mysql workbench. And I got this error:

Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server

If sql server in LAN want to allow another PC outside the LAN to access, what setting should we need? Is it not normal or not common practice?

Herbert
  • 540
  • 1
  • 6
  • 18
  • For me I used tunneling and port forwarding but it might be vulnerable to hackers – Cyrille Con Morales Aug 19 '20 at 08:00
  • @CyrilleConMorales i see. so it is un-common practice to access from outside to mysql server inside LAN, right? – Herbert Aug 19 '20 at 08:11
  • In my opinion yes, because i've been a victim of ransomware luckily i have back it up – Cyrille Con Morales Aug 19 '20 at 08:15
  • @CyrilleConMorales That's too bad that you experienced some ransomware.. Thanks for your advice. – Herbert Aug 19 '20 at 09:02
  • Port forwarding on your office router would handle it, as long as you have the security aspects handled. It is something we used to do for customers, though later on they would use VPNs for added security and improved configuration options. – droopsnoot Aug 24 '20 at 18:36

0 Answers0