<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 6:10 PM, Chirayu Chiripal <span dir="ltr"><<a href="mailto:chirayu.chiripal@gmail.com" target="_blank">chirayu.chiripal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all,<br><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Oct 14, 2014 at 2:04 PM, Madhura Jayaratne <span dir="ltr"><<a href="mailto:madhura.cj@gmail.com" target="_blank">madhura.cj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>Following queries are used to assess whether the logged in user has super, create user and grant privileges respectively. See [1]<br clear="all"><div><br></div><div>SELECT 1 FROM mysql.user LIMIT 1<br></div></div></div></blockquote><div><br></div></span><div>This is used to see if user is phpMyAdmin superuser and for phpMyAdmin, the super user is the user having read access to `mysql.user`.<br></div></div></div></div></div></blockquote><div><br></div><div>Yes, super user has been defined in lighter sense inside phpMyAdmin and seems to differ from SUPER global privilege of  MySQL. So I guess this is fine.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div> <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div><div>SELECT 1 FROM INFORMATION_SCHEMA.USER_PRIVILEGES WHERE PRIVILEGE_TYPE = 'CREATE USER' LIMIT 1</div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>SELECT 1 FROM INFORMATION_SCHEMA.USER_PRIVILEGES WHERE IS_GRANTABLE = 'YES' LIMIT 1<br> <br></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>However, if I create a user with all global privileges except for 'GRANT', 'SUPER', and 'CREATE USER' privileges all the above queries return 1 since the queries does not check for the grantee column. Rows corresponding to root user make all these queries return 1.</div></div></div></blockquote></span><div><br>Similarly, USER_PRIVILEGES tells about the global privileges of current 
logged in user. Even if user is not having Global GRANT privilege he can
 still grant privileges to user (those privileges which he has), So, he is kind of a GRANT user for phpmyadmin.<br></div></div></div></div></div></blockquote><div><br></div><div>I can not seem to do this. My user has SELECT global privilege but fails to grant the same to another user. I get </div><span style="font-family:Consolas,'Lucida Console',monospace;font-size:12px;white-space:pre-wrap"> </span><div><span style="font-family:Consolas,'Lucida Console',monospace;font-size:12px;white-space:pre-wrap">#1045 - Access denied for user 'aaaa'@'localhost' (using password: NO)</span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>I don't know why, but I created a similar user that you have created but using that new user can still create more users using that new user.<br></div></div></div></div></div></blockquote><div><br></div><div>I can do this.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div></div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>This obviously looks a bug to me. I'm writing to make sure that I'm not missing out on something obvious.</div></div></div></blockquote><div><br></div></span><div>Correct me if I am wrong anywhere. I am doing some more research on it.e push notifications.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br></blockquote></div></div></div></div></blockquote><div>Thanks. </div></div><br><br clear="all"><div><br></div>-- <br>Thanks and Regards,<div><br></div><div>Madhura Jayaratne<br><div><br></div></div>
</div></div>