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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access problem

Status
Not open for further replies.

latch

Programmer
Jun 26, 2001
89
DE
Hi

I installed DBI,DBD-MySQl Driver on my Linux box and everything works fine . I
want to restrict access for a user ( called 'user1' ) to the database 'mysql';

This is what I did

I created user called 'user1' with all permissions set to 'Y' in the 'user'
table
I didnt specify any databases for user 'user1' in the 'db' table
and made no entries in the 'host' table either.
Yet user 'user1' is able to access all databases including the database 'mysql';
I want to deny access to the 'mysql' database for user 'user1'

Any help appreciated

Thanx

CM

"Brahmaiva satyam"
-Adi Shankara (788-820 AD)
 
MySQL has an 'optimistic' privelege system - ie, it uses a logical 'OR' on (nearly) all the privelege tables when working out if a user can have access. This means you can't explicitly restrict access, you can only reduce the priveleges that you are enabling.

When you set all the 'Y's in the
Code:
user
table, you are giving global priveleges to the user (to all databases). Perhaps what you want is to change all the 'Y's to 'N's in the
Code:
user
table, then add an entry in the
Code:
db
table for the user/database combination you want to enable.

More information is available on the MySQL site -
-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top