使用 grant 权限列表 on 数据库 to ‘用户名’@’访问主机’ identified by ‘密码’时会出现”……near ‘identified by ‘密码” at line 1”错误
收录于:15天前
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 ‘root’
出现这样的错误的原因是新版本的mysql将创建账户和授予权限的方法分开了。
解决办法是先创建用户,然后授予权限:
创建账户:create user ‘用户名’@’访问主机’ identified by ‘密码’;
赋予权限:grant 权限列表 on 数据库 to ‘用户名’@’访问主机’ ;(修改权限时在后面加with grant option)
create user 'root'@'192.169.230.131' identified by 'root';
grant all on hive.* to 'root'@'192.168.230.131.' WITH GRANT OPTION;
. . .
相关推荐
最新推荐
Mysql多表连接查询执行细节(二)
29天前
nginx
26天前
简单煲机教程
23天前
vue文件上传
23天前
系统资源分析CPU和内存统计以及网络分析
23天前
使用PM2部署spring-boot项目
23天前
ads via 小工具