OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: GRANT and mysql.user table

From: Michael Stassen (mstassenfsc.edu)
Date: Mon Jul 04 2005 - 19:22:49 CDT


l'eaumediacult.com wrote:
> I tried as root having GRANT ALL PRIVILEGES with GRANT OPTION
> to change the privilege of a user:
> GRANT ALL ON mydb.* TO myUser;
>
> The result of this statement is that the query is OK and 0 rows are
> affected.
> WHen I look at the mysql table holding the grants: user, the myUser row
> is unchanged.
>
> What could possibly be preventing the system from changing the GRANT of
> myUser?
> Is the mysql.db table part of the granting?
>
> thanks in advance for your help.
> laurie

Most likely, nothing is preventing the granting of privileges.

Users in mysql are usernamehostname. With GRANT statements, '%' is the
default host, so if you grant to myuser, as opposed to myusermyhost, you are
creating/modifying myuser%. <http://dev.mysql.com/doc/mysql/en/grant.html>

The user table holds global privileges. You are granting a db-specific
privilege. That goes in the 'db' table. Hence, your statement should not
have modified the user tablle.
<http://dev.mysql.com/doc/mysql/en/privileges.html>

Trying to read and interpret the mysql db tables is definitely not the best
way to verify user privileges. Use

   SHOW GRANTS FOR userhost;

instead. <http://dev.mysql.com/doc/mysql/en/show-grants.html>

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql