-1

I have read up on the above error and from the way I understand, there could be many reasons that error pops up. I will try to be as specific as possible.

I have made a php file to do a simple database connect:

<?php
header('Access-Control-Allow-Origin: *');
$servername = "188.166.***.***";
$username = "root";
$password = "mypassword";
$dbname = "vod";
$con = new mysqli($servername,$username,$password,$dbname);
if($con->connect_error){
    die("error ".$con->connect_error);
}
echo "success";
?>

When I run the above code I get the error:

Can't connect to MySQL server on 'XXX.XXX.XXX.XXXX' (111)

When I enter XXX.XXX.XXX.XXX in the URL bar I am taken to the index.html file of the server. And when I enter XXX.XXX.XXX.XXX/phpmyadmin I am taken to phpmyadmin.

I hope I made my question clear.

mnille
  • 1,328
  • 4
  • 16
  • 20
user3583252
  • 493
  • 1
  • 5
  • 15

1 Answers1

0

It depends on you if you want to do it like this:

CREATE USER 'user'@'%' IDENTIFIED BY 'userpassword';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;

you can run it at your query database. just change user and password. good luck

Vijunav Vastivch
  • 4,153
  • 1
  • 16
  • 30