Hello everyone, i have been trying to create a database on a MySql server using a simple PHP script (See below) however when i execute it i get the following error fro mthe Mysql server: "Error creating database: Access denied for user: 'user@serveradd' to database 'dbnameiwant' ?> Could someone look at the coede below and tell me if i am doing something wrong? I am pretty sure my log/pass is ok because if i change them i get an uglier error 😉 (the log/pass was given to me by a school administrator). Here is the code:
<?php
$link = mysql_connect("serveradd", "user", "pass")
or exit("Could not connect");
if (mysql_create_db("dbnameiwant")) {
print ("Database created successfully\n");
} else {
printf ("Error creating database: %s\n", mysql_error ());
}
?>
Thanks for your help.
<?php
$link = mysql_connect("serveradd", "user", "pass")
or exit("Could not connect");
if (mysql_create_db("dbnameiwant")) {
print ("Database created successfully\n");
} else {
printf ("Error creating database: %s\n", mysql_error ());
}
?>
Thanks for your help.