错误如图:
场景,mysql8.0.17修改mysql用户权限,开启所有ip可访问
使用:GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘密码‘ WITH GRANT OPTION;
报错,所以我使用如下方法
使用mysqluse mysql
修改密码:ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘密码‘;
修改ip为所有可访问update user set host=‘%‘ where user=‘root‘;
查看select host,user from user;
刷新flush privileges;
或者可以使用ALTER USER ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘密码‘;
flush privileges;
navicat连接,ok