MySQL Forums
Forum List  »  Newbie

Re: Grant priviliges.
Posted by: Jay Pipes
Date: July 04, 2005 12:08PM

You're getting the Linux user and the MySQL user mixed up. You need to specify a user and host in the grant statement, along with an optional password with the IDENTIFIED BY clause. It does not matter who you are logged into your shell as; what matters is who you're logged into the mysql client as.

log in as root to the mysql client:

#> mysql -uroot -p
Enter password:

mysql> GRANT SELECT ON database.table TO 'user1'@'localhost' IDENTIFIED BY 'some_password';
mysql> exit

then log in as user1 to the mysql client:

#> mysql -uuser1 -p
Enter password:

mysql> SELECT * FROM database.table;

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Written By
Posted
July 03, 2005 07:55PM
Re: Grant priviliges.
July 04, 2005 12:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.