I am trying to create a database via PHP as per w3schools, but I seem not to be able to create a user with permissions to do so, am getting connected ok, but then don't have permissions to create a DB due to permissions.
Connected successfully to the server.
Create a database
ERROR: Unable to execute CREATE DATABASE storeAccess denied for user 'theUser'@'localhost' to database 'store'
the script I am using:
//mysqli_connect(host, username, password, dbname)
$link = @mysqli_connect("localhost", "theUser", "secretPassword") or die("ERROR: Unable to connect: " . mysqli_connect_error());
echo "<p>Connected successfully to the server.</p>";
<h3>Create a database</h3>
$sql = "CREATE DATABASE store";
echo "<p>Database store was created successfully</p>";
echo "ERROR: Unable to execute $sql" . mysqli_error($link);
anyone would know if there is something wrong with the syntax or where I could create powerfull enough account to be able to create the mySQL DB?
Solved! Go to Solution.