1044 - Access denied for user 'root' @ '%' to database 'xahy-blog' Solution two

Check the user table 'root' privileges @ '%' of the grant

select HOST,USER,Grant_priv,Super_priv from mysql.`user`;

Here Insert Picture Description
Now you can see these two rights are N
and we update them for the Y, and then restart mysql

update mysql.user set Grant_priv='Y',Super_priv='Y' where user = 'root' and host = '%';
flush privileges;

Restart mysql

/etc/init.d/mysql restart

Test and then execute the grant statement is successful.

Guess you like

Origin blog.csdn.net/xianhenyuan/article/details/92399618