If you don't specify the user it'll just use the username you run the command as (so root, with sudo).
As noted you should be able to work around the bug with ALTER USER, i.e. running:
sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'passphrase';"
on the command line
If you don't specify the user it'll just use the username you run the command as (so root, with sudo).
As noted you should be able to work around the bug with ALTER USER, i.e. running: native_ password' BY 'passphrase';"
sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_
on the command line