MySQL root grant permission denied

There are times, when  you may come across this situation, when you are not able to grant permission to a new user, even when you are root. This seems to happen , either when you have deleted root account or when you have restored a database from previous version of database dump into a newer version of mysql server. This solution is for the later case. The easiest way to fix this is to run mysql_upgrade command :

mysql_upgrade

Caution : This might repair your other tables too, use it at your own risks. I decided to go the other route :

Mysql user table seems to have 39 rows in version 5.1 and 42 rows in version 5.5 , so in this case, this is because it is not able to find the create tablespace privilage value for root. So we add that column and update the value to Y for root user.

ALTER table mysql.user ADD Create_tablespace_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N' AFTER Trigger_priv, ADD plugin char(64) COLLATE utf8_bin DEFAULT '', ADD authentication_string text COLLATE utf8_bin;

Even just adding the first column seems to work so you could instead run this command :

ALTER table mysql.user ADD Create_tablespace_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N' AFTER Trigger_priv;

And finally run this command :

UPDATE mysql.user set Create_tablespace_priv='Y' where user='root';