MySQL User Privileges list in one shot
<pre><code>SET @s:='';
SELECT @s:= CONCAT('SHOW GRANTS FOR \'',user,'\'@\'',host,'\';') FROM mysql.user where user = 'root';    
PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
</code></pre>

<p>I dont mind to achieve this using any stored proc. Let say I have 2 users with root</p>

<p><strong>'root'@'%'</strong>  and  <strong>'root'@'localhost'</strong>  </p>

<p>What I want is to get result of multiple prepare statements. But the above only executes the last one (ie 'root'@'localhost'). The two challenges I faced</p>

<ol>
<li><a href="http://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html" rel="nofollow">PREPARE</a> / EXECUTE stmt can execute only one query at a time</li>
<li>Only Stored proc can use loop</li>
</ol>

<p><strong>Objective:</strong> All I want is to execute two 'SHOW GRANTS FOR' in one shot</p>