当前位置:   article > 正文

完美解决:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to

error 1064 (42000): you have an error in your sql syntax; check the manual t

目录

一、问题:

二、原因: 

三、解决方法:

四、拓展:


一、问题:

使用下列授权语句:

grant all privileges on mortal.* to 'xiaoqi'@'localhost' identified by 'mortalz7' with grant option;

mortal数据库名  xiaoqi:用户名  localhost:主机名   mortalz7:密码】 

遇到如下问题:

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 'mortalz7' with grant option' at line 1

  

二、原因: 

ERROR 1064(42000):你的SQL语法有错误;查看与MySQL服务器版本对应的手册,在第1行'identified by 'mortalz7' with grant option'附近使用正确的语法

三、解决方法:

(1)首先是否有中文字符,确保所有字符全为英文。

(2)重新执行语句,如还是遇到同样问题,使用如下方法解决:

先创建用户,再授权

创建用户xiaoqi

create user 'xiaoqi'@'localhost' identified by 'mortalz7';

 

创建时遇到ERROR 1819 (HY000): Your password does not satisfy the current policy requirements问题,请查看http://t.csdnimg.cn/fp7tZ】 

授权:

grant all privileges on mortal.* to 'xiaoqi'@'localhost' with grant option;

刷新权限:

flush privileges;

四、拓展:

查看授权

show grants for 'xiaoqi'@'localhost';

删除用户:

drop user 'xiaoqi'@'localhost';

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/508868
推荐阅读
相关标签
  

闽ICP备14008679号