Hi all,
Running an old 10.04 version of ubuntu server, because I must. It's got LAMP on it. I can access MySQL via MySQL workbench, and queries run nicely (I can also access it from the command line). If I try to connect to the database with PHP though, it fails. This is the error message:
Code:
Failed to connect to MySQL: Can't connect to MySQL server on '10.4.56.53' (111)
Any ideas as to why it's not connecting? I've tried adding another user (via CREATE USER) and that user doesn't work either.
Here's the actual connection php:
Code:
<?php
$con=mysqli_connect("10.4.56.53","root","pass","db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT username,password FROM `db`.`users`;");
while($row = mysqli_fetch_array($result))
{
echo $row['username'] . " " . $row['password'];
echo "<br>";
}
mysqli_close($con);
?>
Bookmarks