I have just installed MariaDB 10.4 on macOS Mojave and I now need to set a password for the root
user. I read on other SO questions that I can achieve this via
sudo mysql -u root
MariaDB [mysql]> UPDATE mysql.user SET authentication_string = PASSOWRD('mypassword') WHERE user = 'root';
but this raises error
ERROR 1348 (HY000): Column 'authentication_string' is not updatable
and if I try
UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';
raises error
ERROR 1348 (HY000): Column 'Password' is not updatable
This
set password for 'root'@'localhost' = 'mypassword';
throws
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number
and this
alter user 'root'@'localhost' identified with mysql_native_password by 'mypassword';
throws
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version...
How can I solve this?