This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-17. For the latest, interactive version please visit https://mariadb.com/kb/.

after reset root password I still get "Access denied for user 'root'@'localhost'"

I reset the root password of the mariadb server but when I then try to login, I still get Access denied for user 'root'@'localhost'

To change the root password I did the following: (my setting: 10.0.31-MariaDB-0ubuntu0.16.04.2)

sudo service mysql stop
sudo mysqld_safe --skip-grant-tables &
mysql -u root
MariaDB [(none)]> use mysql;
MariaDB [mysql]> update user set password=PASSWORD("hello") where User='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> exit
sudo service mysql stop
sudo service mysql start

mysql -u root -p
Enter password: <<== here I entered the 'hello' password but still receive:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

So, what am I doing wrong ??

Answer Answered by rvpert in this comment.

Have you any unix_socket authentification plugins?Reset them

``` UPDATE user SET plugin=""; ```

https://superuser.com/questions/949496/cant-reset-mysql-mariadb-root-password

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.