踩坑:Mysql新版本赋权报错,8.0.18版本,use near 'identified by "root" with grant option' at line 1
第一步进入MySQL库中
mysql -uroot -p
use mysql;
然后创建新建一个账号
create user '需要创建的用户名'@'你自己的本机ip' identified by '输入你自己的密码'
例:create user 'root'@'192.168.191.1' identified by 'root'
给用户赋权
grant all privileges on *.* to 'root'@'%' with grant option;
将用户权限加入内存中
flush privileges;