0

i have problem with mac m1, when i connect via ip address error like this

ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (60),

and if connect to external ip address same problem with mac m1, if connect with localhost, it's no problem.

im using xampp 8.2.0-0. firewall has disable, can someone help me, i not have solution with this trouble.

Thank You very much.

connect via LAN same problem, to local with ip address 127.0.0.1 same problem, only can connect if using localhost, ex.

cd /Applications/XAMPP/xamppfiles/bin ./mysql -h localhost -u root 

like this no problem.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
asyadi
  • 1
  • 1
  • 1
    MySQL user accounts have what is called a Domain from which they are allowed to connect. `127.0.0.1` is a domain and `localhost` is a domain. If your user account is only setup with the `locahost` domain, you wont be allowed to connect using `127.0.0.1` – RiggsFolly Feb 23 '23 at 10:46
  • PS: I think XAMPP now only uses `mariaDB` – RiggsFolly Feb 23 '23 at 10:48
  • @RiggsFolly — If that was the issue wouldn't it be an "invalid credentials" error not a "cannot connect" error? – Quentin Feb 23 '23 at 10:56
  • There *must* be a dozen duplicates around somewhere, but I'm pretty sure this will be caused by MySQL being configured to listen on a local UNIX Socket and not on TCP/IP. – Quentin Feb 23 '23 at 10:56
  • @Quentin Good point, must find my glasses – RiggsFolly Feb 23 '23 at 11:01
  • 1
    Connect via localhost and run `SHOW VARIABLES LIKE 'skip_networking';` to check whether `skip_networking` is turned on. If it is, follow instructions in question linked by Quentin. – user1191247 Feb 23 '23 at 11:24

0 Answers0