On Sun, Feb 24, 2002 at 02:15:02PM -0500, Dan Brown wrote:
>
> Quoting Darrell May <[EMAIL PROTECTED]>:
> 
> > Dan I am happy to follow your expertise if you could provide more
> 
>     Well, "expertise" is a bit of an exaggeration, but I'll do what I 
> can...
> 
> > database user information.  It appears this user information is not
> > included as part of the dump file.
> 
>     No, it normally wouldn't be, as it's not part of the table/database 
> as such.  The general syntax would be
> 
> GRANT ALL PRIVILEGES ON database.* TO someuser@localhost IDENTIFIED 
> BY 'somepassword';
> 
>     This gives that user all privileges on the specified database.  It'd 
> probably be more secure to determine exactly which privileges are needed 
> and just grant them, e.g.:
> 
> GRANT SELECT, INSERT, UPDATE, DELETE ON ...
> 
>     I don't know most of them, but they're detailed in the MySQL docs.  
> This line could go at the beginning or end of the dump.  I don't know a 
> way of automatically dumping the information from an existing setup, but 
> is that necessary?  I guess it would depend on what exactly you're trying 
> to do.

Youd want something like this at the top of the file containing the
sql script

CONNECT mysql;

REPLACE INTO user ( host, user, password )
  VALUES ('localhost','user',password('plaintextpassword'));

REPLACE INTO db ( host, db, user, select_priv, insert_priv, update_priv, delete_priv, 
create_priv, drop_priv )
  VALUES ( 'localhost', 'database', 'user', '?', '?', '?', '?', '?', '?');

Assigning privellages as you like...

Ive suggested a few samples to look at previously.
-- 
 Damien

--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to