Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

A little background: A while back I replaced my "root" user with "me" but forgot to give "me" access to the "mysql" table. Tonight I ran "safe" mode with "--skip-grant-tables" and this helped me gain access again:

UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='me';

However, I'm wondering if this grants "me" the maximum privileges possible? I just want to make sure "me" has full access. I don't want to find out a year from now this user is lacking some awesome superpower I need during a crisis.

This in particular has me scratching my head:

mysql> grant all on *.* to me@localhost with grant option;
Query OK, 0 rows affected (0.11 sec)

Are 0 rows affected because "me" already has all privileges or am I doing something wrong?

share|improve this question
up vote 0 down vote accepted

Just do:

USE mysql;

SELECT * FROM `user` WHERE user = 'me' AND host = 'localhost';

And if you see all the Y and none N you have full :D

share|improve this answer
    
Sounds good to me. I'm using "pager less" but for whatever reason "less" isn't showing me the first three columns :-/ Now I just need to work on the Ns. – PJ Brunet Jul 4 '13 at 7:53
    
FWIW I was only missing this "update user set Create_tablespace_priv='Y' where user='me';" – PJ Brunet Jul 4 '13 at 7:58

Try to drop a database that should give you an idea if you have full priveliges or not!

share|improve this answer

There's also some good information here:

show grants;

http://serverfault.com/questions/386903/mysql-grant-option

For example "To be able to do a GRANT ALL on another or new user, the user issuing the GRANT ALL must themselves have every permission or the grant will fail."

share|improve this answer

Try this:

SELECT * FROM `information_schema`.`SCHEMA_PRIVILEGES`;

or

SELECT * FROM `information_schema`.`USER_PRIVILEGES`;

Change root user for your user...

SELECT Host,    Select_priv,    Insert_priv,    Update_priv,    Delete_priv     FROM mysql.user WHERE USER = "root";
SELECT Host,    Create_priv,    Drop_priv,  Reload_priv,    Shutdown_priv   FROM mysql.user WHERE USER = "root";
SELECT Host,    Process_priv,   File_priv,  Grant_priv,     References_priv FROM mysql.user WHERE USER = "root";
SELECT Host,    Index_priv, Alter_priv, Show_db_priv,   Super_priv  FROM mysql.user WHERE USER = "root";
SELECT Host,    Create_tmp_table_priv,  Lock_tables_priv,   Execute_priv    FROM mysql.user WHERE USER = "root";
SELECT Host,    Repl_slave_priv,    Repl_client_priv,   Create_view_priv    FROM mysql.user WHERE USER = "root";
SELECT Host,    Show_view_priv,     Create_routine_priv,    Alter_routine_priv  FROM mysql.user WHERE USER = "root";
SELECT Host,    Create_user_priv,   Event_priv,         Trigger_priv,   Create_tablespace_priv  FROM mysql.user WHERE USER = "root";
SELECT Host,        ssl_type    , ssl_cipher    , x509_issuer,  x509_subject,   max_questions           FROM mysql.user WHERE USER = "root";
SELECT Host, max_updates, max_connections,      max_user_connections        FROM mysql.user WHERE USER = "root";
SELECT Host, plugin, authentication_string  FROM mysql.user WHERE USER = "root";
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.