给某个用户赋权限时报错
[Err] 1045 - Access denied for user 'root'@'%' (using password: YES)
解决办法:
mysql> UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@localhost root]# systemctl restart mysql # 切记需要重启mysql服务
然后在赋权限
CREATE USER 'newuser'@'%' IDENTIFIED BY '123456';
grant all privileges on *.* to 'newuser'@'%' ;