dbTalk Databases Forums  

MySQL: permissions to databases, tables, views

comp.databases.mysql comp.databases.mysql


Discuss MySQL: permissions to databases, tables, views in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
alfa
 
Posts: n/a

Default MySQL: permissions to databases, tables, views - 12-08-2010 , 07:29 AM






I've got some question about MySQL privileges

MySQL version 5.1.30 running on FreeBSD (build from ports)

I describe what i do:
- I have created 2 databases: db1 and db2
- I have created tables at db1: db1tab1 db1tab2
- I have created tables at db2: db2tab1 db2tab2
- I have created view at db1 named db1view (as select * from db1tab1)

next i create user and privileges for them:

grant select on db1.db1view to 'user1'@'%' identified by 'password1';
flush privileges;


And my question is... why when i connect to database as user1, i can:
select * from db1tab1 or db1tab2
(I think I should be able to do only "select" from "view"). Also i can
use db2, i can do: select from
db2tab1 or db2tab2. Also I can see all databases, all tables. How can
i prevent from this? How can I show
only one table (or view) from specific database for specified user?

Reply With Quote
  #2  
Old   
Luuk
 
Posts: n/a

Default Re: MySQL: permissions to databases, tables, views - 12-08-2010 , 07:52 AM






On 08-12-10 14:29, alfa wrote:
Quote:
I've got some question about MySQL privileges

MySQL version 5.1.30 running on FreeBSD (build from ports)

I describe what i do:
- I have created 2 databases: db1 and db2
- I have created tables at db1: db1tab1 db1tab2
- I have created tables at db2: db2tab1 db2tab2
- I have created view at db1 named db1view (as select * from db1tab1)

next i create user and privileges for them:

grant select on db1.db1view to 'user1'@'%' identified by 'password1';
flush privileges;


And my question is... why when i connect to database as user1, i can:
select * from db1tab1 or db1tab2
(I think I should be able to do only "select" from "view"). Also i can
use db2, i can do: select from
db2tab1 or db2tab2. Also I can see all databases, all tables. How can
i prevent from this? How can I show
only one table (or view) from specific database for specified user?
what does 'SHOW GRANTS' say?

http://dev.mysql.com/doc/refman/5.1/en/show-grants.html

--
Luuk

Reply With Quote
  #3  
Old   
alfa
 
Posts: n/a

Default Re: MySQL: permissions to databases, tables, views - 12-08-2010 , 01:59 PM



ok problem was solved

in database: information_schema
in table: schema_privileges
i've found user: ''@'%'

when i drop user ''@'%' my problem disappeared
this user was the problem and MySQL pokzaywaƂ those strange things.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.