I am trying to insert some data from the client browser to a MySQL database on AWS server.
The code worked on godaddy so it looks like a permissions/security issue.
$servername = "xx.xx.xx.xx";
$username = "user";
$password = "mypass";
$dbname = "dbName";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO mytable ('email')
VALUES ('" . $email . "')";
echo $sql;
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
I am getting the error saying "Connection failed: Host x.x.x.x is not allowed to connect to this MySQL server "
How do I allow connections to this from a client browser?
I have already commented out the line bind-address = 127.0.0.1
Aucun commentaire:
Enregistrer un commentaire