参考 :
https://blog.csdn.net/wm9028/article/details/88342600
https://www.cnblogs.com/chentop/p/10296310.html
登录mysql , 使用名称为mysql 的数据库
设置允许连接
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123';
刷新权限
flush privileges;
设置root账号允许任意ip登录(可选,执行该操作需要刷新权限)
update mysql.user set host = '%' where user = 'root';
END。