List:General Discussion« Previous MessageNext Message »
From:Bob Kline Date:October 17 1999 2:31am
Subject:Re: access to mysql database
View as plain text  
On Sat, 16 Oct 1999, Chris W. wrote:

> Hello people, sorry for this very basic question but I got very
> confused with access privileges to mysql. Until now I was using root
> to setup all the tables and there was only access to this computer
> for myself only, but I have a friend of mine who I want to give
> access to mysql database but I don't want him to screw up my work or
> erase something of mine by accident so I want to create database
> indfilm and user Tom that will have access only to database indfilm
> and he will be able to create tables, delete them and everything but
> will not be able to create new database or access other databases or
> edit them... How do I do that? I added user Tom to user table in
> mysql.
> 
> I am confused. Ok, what privileges should I have set for normal user
> and what privileges should I have setup for administrator?
> 
> This is confusing, I was able to finally make user Tom to not be
> able to create any tables but then he was able to access other
> databases on the system instead only indfilm, so how do I set it up
> so user Tom can only access indfilm database and be able to do
> everything he wants with that particular database but he will not be
> able to see other databases or do anything to them?
> 

What happens if you try this?

REVOKE ALL PRIVILEGES ON *.* FROM tom;

Then:

GRANT          SELECT, INSERT, UPDATE, DELETE 
ON             indfilm.* 
TO             tom@localhost
IDENTIFIED BY  'Y8afZ7tr';

 (if you don't want him to be able to create tables, as you implied at
  the beginning of your last paragraph; or)

GRANT          ALL PRIVILEGES 
ON             indfile.* 
TO             tom@localhost 
IDENTIFIED BY  'Y8afZ7tr';

 (if you want him "to do everything he wants with that particular
  database" as you imply elsewhere in your message; even this second
  approach leaves out WITH GRANT OPTION.)

Make up your own passwords, of course.

No mysteries or secrets here, by the way; see section 7.25, "GRANT and
REVOKE syntax" or section 6.11, "Adding new user privileges to MySQL."

-- 
Bob Kline
mailto:bkline@stripped
http://www.rksystems.com

Thread
access to mysql databaseChris W.16 Oct
  • Re: access to mysql databaseBob Kline17 Oct