进入mysql控制台

mysql -u root -p

use mysql

alter user 'root'@'%' identified with mysql_native_password by '1234';

flush privileges;