Date: Sun, 22 Jun 2003 19:32:50 -0400 From: John Von Essen <john@essenz.com> To: Konrad Scorciapino <fallenbr@uol.com.br> Cc: freebsd-questions@freebsd.org Subject: Re: Granting access on MySQL Message-ID: <D69398AD-A509-11D7-AC51-0003933DDCFA@essenz.com> In-Reply-To: <20030622194538.141630d0.fallenbr@uol.com.br>
next in thread | previous in thread | raw e-mail | index | archive | help
Konrad, What errors did you get? Your GRANT command seems unusual. You would do something like: GRANT ALL ON databasename.* TO username@localhost IDENTIFIED BY "password" or GRANT ALL ON databasename.* TO username@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@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@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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > > John Von Essen (john@essenz.com) President, Essenz Consulting (www.essenz.com) Phone: (800) 248-1736 Fax: (800) 852-3387
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D69398AD-A509-11D7-AC51-0003933DDCFA>