Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent users creating their own databases

Status
Not open for further replies.

col69

IS-IT--Management
Jun 22, 2002
7
GB
Hi,

I've installed 4.0.22 and phpMyAdmin 2.6.0-pl2 and followed the instructions, removed the "guest" accounts. Granted users ALL privs on their own db only, which I created. Globally users just have the USAGE priv, no create priv but users can still create their own databases which I need to prevent. What am I missing ?

Cheers
 
Don't grant all, grant only what is needed for the app to work. My personal preference is to grant (select, update, insert, connect [,delete if needed])

It really depends on what those users and applications needs to do.

Bastien

Cat, the other other white meat
 
Still having a problem, revoke all privs does prevent db creation via mysql monitor but if then grant select,update etc but not create on their database they can still create other new databases.

Weirder still, if revoke all for that user and then login as the user using phpMyAdmin I can create a new database despite having no privs apart from USAGE ??? This has been set up as per phpMyAdmin instructions.

Any ideas - is really possible to create a db for a user, give them privileges to it, but prevent them from creating other new databases ? Example grants would be helpful :)
Cheers
 
grant select, update, insert on *.* to 'username' identified by password('some_password');

change the *.* to id a specific db ie test.*

phpmyadmin by default has root privileges (thats the normal account used to admin the db) otherwise adminning the db would be really tough


When privielges are changed, issue the command 'flush privileges' to have the new ones take effect the NEXT time the user logs in

Bastien

Cat, the other other white meat
 
Sorry, should have said this is a multi user environment where I want users to be able to admin their own db via phpMyAdmin using their own mysql login but not create any new db's. The docs. not say how to disable this functionality, well apart from hacking the php code :)
 
setting phpmyadmin is complex...there is a really good book on this

matering phpmyadmin for effective mysql mgmt
by marc delisle
isbn 1-904811-03-5

chapter 17 talks about this:



Bastien

Cat, the other other white meat
 
If I set CREATE, INSERT, UPDATE, ALTER, DELETE, DROP for their database only, phpMyAdmin tells me that the user in question cannot create the database. But it is still possible under MySQL command line. Using latest phpMyAdmin and MySQL 4.1.7, by the way, if that helps you any col69.

----------------------------
"Security is like an onion" - Unknown
 
Be careful, rights for username@localhost, usename@% and username@specific.hosts.com are different.
 
Thanks for the tips. Unfortunately, phpMyAdmin version 2.6.0-pl2 doesn't work with mysql-standard-4.1.7 on my platform. Throws error about client incapatiblity, so I'm stuck with 4.0.22. We are using latest PHP as well. Are there any other web admin interfaces similar to phpMyAdmin that I could use in a multi user setup ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top