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; #刷新权限