进入mysql执行命令

alter user 'root'@'%' identified by '123456';

参考链接
https://blog.csdn.net/ChamPly/article/details/84729999