plivilegio de crear user
Publicado por sin dientes (25 intervenciones) el 27/06/2007 20:18:31
buenas tardes,
tengo un problema, con root cree nu usuario usu1 el cual lo utilizare como administrador del sistema, el problema que tengo es que a la hora de crear un nuevo usuario me dice q no tengo privilegios de create user, alguien me puede ayudar,
este usuario tiene priv para user, table_priv y db, en user le hice un update a create_user_priv, pero aun asi me manda el mismo error.
si alguien sabe q puede ser le pido me oriente muchas gracias..
este es el codigo q utilice para crear al usuario usu1. esta en php.
<?php require_once('includes/conexion2.php'); ?>
<?php
session_start();
include("includes/lib_desc_1.php");
//
$x2='1022';
$x3='1122';
//
$clvprv1=$_SESSION['clvprv1'];
$passw=$_SESSION['Psw'];
$conmy = mysql_connect($_SESSION['server'], 'root', 'pelos');
if (!$conmy) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($_SESSION["basedatomy"],$conmy);
//
$insertSQLh = sprintf("CREATE USER '%s'@'localhost' IDENTIFIED BY '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on sysgenped.* to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
//
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on mysql.user to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
//
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on mysql.tables_priv to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on mysql.db to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("update user set create_user = 'Y' where user = '%s",$x2);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("FLUSH PRIVILEGES");
$Result1 = @mysql_query($insertSQLh, $conmy);
printf("grrant FLUSH PRIVILEGES");
?>
este es el error q me da
Access denied; you need the CREATE USER privilege for this operation
gracias por su ayuda bien dia.
tengo un problema, con root cree nu usuario usu1 el cual lo utilizare como administrador del sistema, el problema que tengo es que a la hora de crear un nuevo usuario me dice q no tengo privilegios de create user, alguien me puede ayudar,
este usuario tiene priv para user, table_priv y db, en user le hice un update a create_user_priv, pero aun asi me manda el mismo error.
si alguien sabe q puede ser le pido me oriente muchas gracias..
este es el codigo q utilice para crear al usuario usu1. esta en php.
<?php require_once('includes/conexion2.php'); ?>
<?php
session_start();
include("includes/lib_desc_1.php");
//
$x2='1022';
$x3='1122';
//
$clvprv1=$_SESSION['clvprv1'];
$passw=$_SESSION['Psw'];
$conmy = mysql_connect($_SESSION['server'], 'root', 'pelos');
if (!$conmy) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($_SESSION["basedatomy"],$conmy);
//
$insertSQLh = sprintf("CREATE USER '%s'@'localhost' IDENTIFIED BY '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on sysgenped.* to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
//
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on mysql.user to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
//
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on mysql.tables_priv to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("grant select,insert,update,delete,create,drop,alter
on mysql.db to '%s'@'localhost' identified by '%s'",$x2,$x3);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("update user set create_user = 'Y' where user = '%s",$x2);
$Result1 = @mysql_query($insertSQLh, $conmy);
$insertSQLh = sprintf("FLUSH PRIVILEGES");
$Result1 = @mysql_query($insertSQLh, $conmy);
printf("grrant FLUSH PRIVILEGES");
?>
este es el error q me da
Access denied; you need the CREATE USER privilege for this operation
gracias por su ayuda bien dia.
Valora esta pregunta


0