Can't access mysql on a pc connected over LAN?

2

these are the details of my device

   IPv4 Address. . . . . . . . . . . : 192.168.1.110
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.254

and i want to access mysql on device with ip

IPv4 = 192.168.1.24

ping is also not working

C:\Users\ITDESK>ping 192.168.1.24

Pinging 192.168.1.24 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.1.24:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

mickey

Posted 2016-11-24T07:47:32.937

Reputation: 33

1Check firewall on the target machine. – djsmiley2k TMW – 2016-11-24T07:56:30.430

Answers

1

Additionally to checking and fixing the firewall as djsmiley2k mentioned, you should setup MySQL to accept connections from other computers than localhost.

GRANT ALL PRIVILEGES ON *.* TO db_user @'192.168.1.110' IDENTIFIED BY 'db_passwd';

Will allow the user db_user to do everything on ALL databases if he can present the correct password. You should over think this of course if you switch to production environment, as granting everything everywhere is "kind of dangerous".

You also should configure your MySQL to bind to address 0.0.0.0 which means every IP the host has. Per default it would be set to 127.0.0.1 (only connections from localhost) You can change this value in the my.cnf located at /etc/my.cnf or /etc/mysql/my.cnf

Your "IP stlye" suggests you are trying this in a private network, maybe you have to configure your router to allow traffic between computers, as some routers (the FritzBox brand for example) disallow this kind of traffic per default.

DBX12

Posted 2016-11-24T07:47:32.937

Reputation: 166

Glad I could help you – DBX12 – 2016-11-24T08:54:24.813