$mysqli = new mysqli("192.168.3.50", "root", "123", "db_name"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", $mysqli->host_info); /* close connection */ $mysqli->close(); 

I get the error:

 Connect failed: Access denied for user 'root'@'192.168.3.57' (using password: YES) 

where 192.168.3.57 is my address.

What could be wrong?

  • one
    Is the password correct? - Nikita Umnov 2:29 pm
  • Yes, the password is correct - Sergey
  • Does it work from the local machine? by localhost - Nikita Umnov
  • yes, there is a connection via localhost - Sergey
  • User was invalid (it worked, thanks. - Sergey

0