Comment 1 for bug 1485989

Revision history for this message
Giuseppe Maxia (giuseppe-maxia) wrote :

This is not a bug. You can already run the grant command using the root user, which has the grant privilege:

~/sandboxes/rsandbox_mysql-5_6_26/m -u root

master [localhost] {root} ((none)) > show grants for root@'localhost'\G
*************************** 1. row ***************************
Grants for root@localhost: GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
*************************** 2. row ***************************
Grants for root@localhost: GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
2 rows in set (0.00 sec)

master [localhost] {root} ((none)) > show grants for msandbox@'127.%'\G
*************************** 1. row ***************************
Grants for msandbox@127.%: GRANT ALL PRIVILEGES ON *.* TO 'msandbox'@'127.%'
1 row in set (0.00 sec)

master [localhost] {root} ((none)) > show grants for msandbox_rw@'127.%'\G
*************************** 1. row ***************************
Grants for msandbox_rw@127.%: GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON *.* TO 'msandbox_rw'@'127.%'
1 row in set (0.00 sec)

master [localhost] {root} ((none)) > show grants for msandbox_ro@'127.%'\G
*************************** 1. row ***************************
Grants for msandbox_ro@127.%: GRANT SELECT, EXECUTE ON *.* TO 'msandbox_ro'@'127.%'
1 row in set (0.00 sec)

Similarly, you can use a less privileged user

~/sandboxes/rsandbox_mysql-5_6_26/m -u msandbox_rw

~/sandboxes/rsandbox_mysql-5_6_26/m -u msandbox_ro