basf
11-13-2004, 09:08 AM
Hello,
I'm writing a php script to create databases, user which has got all permissions to database created by script.
It means script do:
- create database "database5"
- create admin "admin5" with all permission to database5 - GRANT ALL ON baza5.* TO admin5@localhost IDENTIFIED BY 'somepassword'
mysql_query("CREATE DATABASE $NazwaBazy");
$q = 'GRANT ALL ON ' . $NazwaBazy . '.*' . ' TO ' . $Admin . '@localhost' . ' IDENTIFIED BY ' . '\'' . $Passwd . '\'' ;
mysql_query("$q");
When I run mysql manually:
mysql> GRANT ALL ON baza5.* TO admin5@localhost IDENTIFIED BY 'fff';
ERROR 1044: Access denied for user: 'panel@localhost' to database 'baza5'
User panel has got global permission to CREATE and GRANT
So why it doesn't work?
How can I create an user with permission to grant permissions to other databases and users?
I don't want use root account in mysql...
Thank you for help,
Regards
Adam
I'm writing a php script to create databases, user which has got all permissions to database created by script.
It means script do:
- create database "database5"
- create admin "admin5" with all permission to database5 - GRANT ALL ON baza5.* TO admin5@localhost IDENTIFIED BY 'somepassword'
mysql_query("CREATE DATABASE $NazwaBazy");
$q = 'GRANT ALL ON ' . $NazwaBazy . '.*' . ' TO ' . $Admin . '@localhost' . ' IDENTIFIED BY ' . '\'' . $Passwd . '\'' ;
mysql_query("$q");
When I run mysql manually:
mysql> GRANT ALL ON baza5.* TO admin5@localhost IDENTIFIED BY 'fff';
ERROR 1044: Access denied for user: 'panel@localhost' to database 'baza5'
User panel has got global permission to CREATE and GRANT
So why it doesn't work?
How can I create an user with permission to grant permissions to other databases and users?
I don't want use root account in mysql...
Thank you for help,
Regards
Adam
