mysql8.0无法给用户授权或提示You are not allowed to create a user with GRANT的问题

mysql8.0无法给用户授权或提示You are not allowed to create a user with GRANT的问题

提示意思是不能用grant创建用户,mysql8.0以前的版本可以使用grant在授权的时候隐式的创建用户,8.0以后已经不支持,所以必须先创建用户,然后再授权,命令如下:

mysql> create user 'root'@'xx.xx.xx.xx' identified by 'xxxxxxxxx';
Query OK, 0 rows affected (0.05 sec)

mysql> grant all privileges on *.* to 'root'@'xxxxx.xx.xx.xx';
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)

猜你喜欢

转载自blog.csdn.net/wuxingpu5/article/details/120308679
今日推荐