Granting access on MySQL

John Von Essen john at essenz.com
Sun Jun 22 16:34:46 PDT 2003


Konrad,

What errors did you get? Your GRANT command seems unusual. You would do 
something like:

GRANT ALL ON databasename.* TO username at localhost IDENTIFIED BY 
"password"
or
GRANT ALL ON databasename.* TO username at machine.domain.com IDENTIFIED 
BY "password"

The second is if you connect remotely.

Obviously, the user has to exist before you do the GRANT. Also, it is 
not wise to do GRANT ALL on a database unless the user is going to be 
at superuser level. You do the GRANT at the table level. Say the table 
is account_info. You would do:

GRANT ALL ON databasename.account_info TO username at localhost IDENTIFIED 
BY "password"

If you don't want to do ALL, you can be specific:

GRANT DELETE,INSERT,SELECT,UPDATE ON databasename.account_info TO 
username at localhost IDENTIFIED BY "password"

If you still have trouble look at the tables in the mysql database, in 
particular, the db and user tables.

-John

On Sunday, June 22, 2003, at 06:45 PM, Konrad Scorciapino wrote:

> Hello,
>
> I need to grant a user access to a database. How can I do it?
>
> This is what I've tried:
>
> mysql> grant all on databasename.* to username;
>
> I got no error messages, but I after connecting as the user, I 
> couldn't use the database.
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at freebsd.org"
>
>
John Von Essen (john at essenz.com)
President, Essenz Consulting (www.essenz.com)
Phone: (800) 248-1736
Fax: (800) 852-3387



More information about the freebsd-questions mailing list