|
When I try to put "CREATE USER" statement in my php file, I get this ridiculous message: "Access denied; you need the CREATE USER privilege for this operation".
For reference: I'm using Inmotionhosting server, which has the graphic tools MySqlDatabases, MySQLDatabaseWizard, phpMyAdmin, and RemoteMySQL. In "MySQLDatabases", I have selected "Add User to Database" option , added user "db_login", and checked "ALL PRIVILEGES" box to make sure that my administrative user db_login has all the priviliges.
///////////////////////////////////////////////////////////
<?php
addNewUser("user_id","user_pw");
function addNewUser($id,$pw)
{
$db = mysql_connect('localhost','db_login','db_password') or die("Couldn't connect to the database.");
mysql_select_db('my_database') or die("Couldn't select the database");
$query="CREATE USER " . $id . " IDENTIFIED BY PASSWORD " . "'" . $pw . "'";
$result=mysql_query($query) or die ('Query failed: '.mysql_error());
}
?>
//////////////////////////////////////////////////
What could be causing the problem?
|