MariaDB-10.4+ the mysql
.user
is a view rather than a table.
Its recommend to stop copying off old blogs to do any authentication relates changes in MySQL and MariaDB, the mechanisms are being updated and no longer apply. Always check the official documentation.
Use SET PASSWORD or ALTER USER to manage user authentication.
Also modifying a user/host component of the username will put triggers, events, plugins, grants, roles etc out of sync with the combined username (aka broken). So just DROP/CREATE users rather than manipulate them.