Hi,

Guys i need a simple help from you guys. There's a scenerio that i m sure is very common in mysql and i know most of you can answer that but i m new to mysql so need some basic polish.

so my scenerio is that for example i have 100 database.
i create a new database (sample)
now i create new user (user1)
now i want to give grant access to user1 on all databases except SAMPLE..
what i should do ??

NOTE: What i did was give

Grant all privileges on *.* to 'user1'@'localhost';
revoke all privileges on sample.* from 'user'@'localhost';

now you all know that what error mysql gave when revoking...its say that no privileges define to revoke etc...

how you guys do it??

Thanks.

What kind of a setup is this where a user may handle all databases except one? Sound like Bluebeard's Lair.
If I ever had this problem I would write a script (on OS level) which processes a list of database names, a username and an exception name as arguments and grants all privileges for any of the database which does not match the exception name.

This is not a real scenerio bro..i just want to know what is standard that everyone follows if the querry is small...i know scripting will do the job but is there any other way around??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.