From owner-freebsd-questions@FreeBSD.ORG Sun Jun 22 16:34:45 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE78F37B401 for ; Sun, 22 Jun 2003 16:34:45 -0700 (PDT) Received: from beck.quonix.net (beck.quonix.net [64.239.136.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5647B43F93 for ; Sun, 22 Jun 2003 16:34:45 -0700 (PDT) (envelope-from john@essenz.com) Received: from essenz.com (pcp04098733pcs.neave01.pa.comcast.net [68.80.102.17]) by beck.quonix.net (8.12.9/8.12.9) with ESMTP id h5MNYaE7069276; Sun, 22 Jun 2003 16:34:36 -0700 (PDT) (envelope-from john@essenz.com) Date: Sun, 22 Jun 2003 19:32:50 -0400 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) To: Konrad Scorciapino From: John Von Essen In-Reply-To: <20030622194538.141630d0.fallenbr@uol.com.br> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) cc: freebsd-questions@freebsd.org Subject: Re: Granting access on MySQL X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2003 23:34:46 -0000 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