title: MariaDB ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
body: <p>I was doing everything without success :( I still get error if I try to change mysql root password</p>
  
  <p>What I have done till now:
  1)</p>
  
  <pre><code>service mysql stop
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>mysqld_safe --skip-grant-tables &amp;
  </code></pre>
  
  <p>3)</p>
  
  <pre><code>mysql -u root
  </code></pre>
  
  <p>4)</p>
  
  <pre><code>update user SET PASSWORD=PASSWORD("&lt;my_new_password&gt;") WHERE USER='root'; flush privileges; exit
  </code></pre>
  
  <p>5)</p>
  
  <pre><code>mysql -u root -p 
  </code></pre>
  
  <p>and...</p>
  
  <p>Im getting whole time:</p>
  
  <pre><code>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  </code></pre>
  
  <p>My server is ubuntu 16.0.4</p>
  
  <p><strong>Could some tell me please if I reinstall mariaDB I will still have my databases?</strong> Right now I can not even do a backup :(</p>