grant all privileges on *.* to 报错问题

参考链接
报了十几次这个错误

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near 'identified by '你的密码'' at line 1

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

mysql> CREATE USER 'root'@'%' IDENTIFIED BY '你的密码';
Query OK, 0 rows affected (0.48 sec)

mysql> grant all privileges on *.* to 'root'@'%';
Query OK, 0 rows affected (0.48 sec)
全部评论

相关推荐

群星之怒:不是哥们,你就不好奇瘫痪三十年的老植物人是啥样的吗?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务