Connecting to Xampp SQL server from the network

  heroku, mysql, mysqli, php, windows

I deployed a USSD application on Heroku but testing it in a Sandbox environment has been a painstaking process due to

Warning: mysqli::__construct() : (HY000/2002) : Connection refused in /app/dbConn.php on line 8

The code causing this error:

$connection = new mysqli($hostname, $username, $password, $database);

The hostname and username:

$hostname = '127.0.0.1:3306';
$username = 'aaron';

I have tried configuring MySQL (my.ini) to bind-address="192.168.0.1" no success. I also configured as such bind-address="0.0.0.0", still no success.

I tried to change hostname to localhost, still couldnt connect.

I also changed the host (for root user and aaron) on phpmyadmin to Any Host all in vain.

The status of the request from the API i am using is however 200. Kindly offer pointers on how to fix this.

Source: Windows Questions

LEAVE A COMMENT