Для MySQL 5.7
update user set authentication_string=password('PaSsWoRd') where user='root';
Для MySQL 8.x
ALTER USER 'root'@'localhost' IDENTIFIED BY 'PaSsWoRd!';
Для MySQL 5.7
update user set authentication_string=password('PaSsWoRd') where user='root';
Для MySQL 8.x
ALTER USER 'root'@'localhost' IDENTIFIED BY 'PaSsWoRd!';