找到MySQL服务的pid,服务命为实际的服务名,如MySQL57
sc queryex MySQL
杀死这个进程,xxxx为具体的PID
taskkill /PID xxxx /f
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root123‘ WITH GRANT OPTION;
允许用户从ip为192.168.1.64的主机连接到mysql服务器,并使用root123作为密码
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘192.168.1.64‘ IDENTIFIED BY ‘root123‘ WITH GRANT OPTION;
刷新输入命令,亲测不刷新也可以:
FLUSH PRIVILEGES;
select Host,User,Password from mysql.user;
原文:https://www.cnblogs.com/fly-book/p/14825357.html