mysql8设置用户权限报错You have an error in your SQL syntax;right syntax to use near ‘IDENTIFIED BY

  • Post author:
  • Post category:mysql


mysql 8 设置用户权限命令和之前不一样

之前:


grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;

报错:

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 ‘123456’ WITH GRANT OPTION’ at line 1

现在:


CREATE USER 'myuser'@'%' IDENTIFIED BY '123456';

#创建用户


grant all privileges on *.* to 'myuser'@'%' ;

#分配权限


FLUSH PRIVILEGES;

#刷新权限



版权声明:本文为sherryaxx原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。