Ajoy
Ajoy

Reputation: 209

mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known

I am trying to connect my local PHP program from one PC and Mysql from a server or another PC. But I got following error when I tried this

Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\xampp\htdocs\bharat\bharat\connect.php

Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\xampp\htdocs\bharat\bharat\connect.php

Warning: mysqli_error() expects parameter 1 to be mysqli, string given in D:\xampp\htdocs\bharat\bharat\connect.php

<?php
$con = mysqli_connect('https://192.168.43.215', 'root', '12345678', 'bharat') or die(mysqli_error("Error connection"));

I tried to keep mysql database in remote server for data security and software in local machine. Can any one tell me the exact way. Thank you.

Upvotes: 0

Views: 3570

Answers (1)

Anne Douwe
Anne Douwe

Reputation: 691

You don't need the https://, this would be sufficient:

<?php
$con = mysqli_connect('192.168.43.215', 'root', '12345678', 'bharat') or die(mysqli_error("Error connection"));

Upvotes: 1

Related Questions