List:General Discussion« Previous MessageNext Message »
From:Benjamin Pflugmann Date:April 19 1999 4:46pm
Subject:Re: creating new users
View as plain text  
Hi!

On Mon, Apr 19, 1999 at 05:04:25PM -1100, david@stripped wrote:
> Mysql folks,
> 
> I've been trying to create users with access to databases which
> begin with their userid, i.e., userid "drs8h" would have control
> over any mysql database which begins with "drs8h_*".  I use the following
> statements:
> 
> 
> use mysql;
> 
> insert into user values('localhost','drs8h',PASSWORD('!!drs8h'),
> 'Y','Y','Y','Y','Y','Y','N','N','N','N','N','N','Y','Y');
> 
> insert into user values('%','drs8h',PASSWORD('!!drs8h'),
> 'Y','Y','Y','Y','Y','Y','N','N','N','N','N','N','Y','Y');
> 
> insert into db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,
> Create_priv,Drop_priv,Index_priv,Alter_priv) i
> values ('localhost','drs8h_*','drs8h','Y','Y','Y','Y','Y','Y','Y','Y');
> 
> insert into db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,
> Create_priv,Drop_priv,Index_priv,Alter_priv) 
> values ('%','drs8h_*','drs8h','Y','Y','Y','Y','Y','Y','Y','Y');
> 
> flush privileges;
> 
> 
> Can anyone tell me what's wrong with this, or if what I'm trying to do
> won't work at all?  Thanks.

You should try % instead of * (% is the joker in SQL):

> insert into db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,
> Create_priv,Drop_priv,Index_priv,Alter_priv)
> values ('%','drs8h_%','drs8h','Y','Y','Y','Y','Y','Y','Y','Y');

Btw, the other insert statement is unnescessary, since % also matches
localhost, AFAIK.

> Also, a more esoteric question: I noticed that client connections using mysql
> won't work at all when the ~/.my.cnf file exists *and* when the user shell
> invoking the command exists because of a prior "su -" command (i.e., there is
> more than one "login" shell in the process group).  Anybody know what's the 
> reason for this?

*shrug* no.

Bye,

	Benjamin.


Attachment: [application/pgp-signature]
Thread
creating new usersDavid R. Saunders19 Apr
  • Re: creating new usersBenjamin Pflugmann19 Apr
  • Re: creating new usersChristian Mack19 Apr