Hello.
I have an account on a webhosting, where I can run my php codes. There is also database support.
Today I tried to create my first database. Code:
[code]
<?php
$servername = “localhost”;
$username = “nerio”;
$password = “1234”;
// create connection
$conn = new mysqli($servername, $username, $password);
// check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}
// create my first database
$sql = “CREATE DATABASE myFirstDB”;
if ($conn->query($sql) === TRUE) {
echo “Database created successfully”;
} else {
echo “Error creating database: ” . $conn->error;
}
$conn->close();
?>
It returned the following error: Connection failed: Access denied for user ‘nerio’@’localhost’ (using password: YES)
What is wrong?
Thank you.