---
slug: "mysql-missing-with-grant-option-for-root"
title: "MySQL: Lost the WITH GRANT OPTION Privilege from Root"
description: "While managing the root user with the mysql_user module in Ansible, I found that I was no longer able to grant privileges to other users."
url: "https://www.ytyng.com/en/blog/mysql-missing-with-grant-option-for-root"
publish_date: "2018-02-26T13:14:58Z"
created: "2018-02-26T13:14:58Z"
updated: "2026-02-27T07:35:08.618Z"
categories: ["MySQL"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/d3164ec97fd043029b9f4bf4e7dc9ad5.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# MySQL: Lost the WITH GRANT OPTION Privilege from Root

<p>While managing the root user with the mysql_user module in Ansible, I found that I was no longer able to grant privileges to other users.</p>

<p></p>

<p>When I checked the grants for root, I saw:</p>

<pre>mysql&gt; show grants;<br />+--------------------------------------------------------------+<br />| Grants for root@localhost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />+--------------------------------------------------------------+<br />| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'            |<br />| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION |<br />+--------------------------------------------------------------+</pre>

<p>The WITH GRANT OPTION was missing.</p>

<p></p>

<p>In such a case, you can forcefully set the Grant_priv by executing:</p>

<pre style="background-color: #ffffff; color: #000000; font-family: 'Menlo'; font-size: 9.0pt;"><span style="color: #000080; font-weight: bold;">UPDATE </span>mysql.user <span style="color: #000080; font-weight: bold;">SET </span><span style="color: #660e7a; font-weight: bold;">Grant_priv </span>= <span style="color: #008000; font-weight: bold;">'Y' </span><span style="color: #000080; font-weight: bold;">WHERE </span><span style="color: #660e7a; font-weight: bold;">User</span>=<span style="color: #008000; font-weight: bold;">'root'</span>;</pre>

<p>(You might need to run FLUSH PRIVILEGES; afterward?)</p>

<p></p>

<p>The correct show grants should look like this:</p>

<pre>mysql&gt; show grants;<br />+---------------------------------------------------------------------+<br />| Grants for root@localhost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />+---------------------------------------------------------------------+<br />| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |<br />| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />+---------------------------------------------------------------------+</pre>

<p>This is how it should appear.</p>

<p></p>

<p></p>
