alter user root mysql
snippet in sql

set password mysql

user2164

-- In case the UPDATE command returns "Column 'Password' is not updatable" run
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';
flush privileges;

alter user root mysql

user450

ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';

change mysql password from command line

user384

ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password';