Set authentication_string in Mysql 8.0.19

Trying to reset root's password, I end up at this line:

update user set authentication_string=password('1234') where user='root'

which leads to a mean syntax error

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('1234') where user='root''

replacing password('1234') by '1234' works, so it looks like the 'password' function got missing. How do I hash my password then?


Use ALTER_USER instead of SET authentication_string:

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