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