Linux – thesql (mariadb) ERROR 1698 (28000): Access denied for user ‘root’@’localhost’

linuxmariadbMySQLpasswords

I'm working on Xubuntu 15.04. I already installed the MariaDB-Server on various systems and was always asked for a root password during installation. This time, however, I don't remember being asked for the password. When I try to login without a password (or a blank password), I get the Access denied for user 'root'@'localhost' error.
I tried uninstalling the package completely by

sudo apt-get remove mariadb-server
sudo apt-get purge mariadb-server

When I reinstalled, I still didn't get asked for the root password.

I tried the mysqld --skip-grant-tables approach from
mysql how to fix Access denied for user 'root'@'localhost' .
I can modify the password for the root user in the mysql database – at least the hash value changes – but I still cannot login with the new password after a restart of the mysql-server. I still get the same error.

The user debian-sys-maint does not exist. So, I cannot use it to fix anything.

Any ideas what else I could try?

Best Answer

You need to reset the password. so for that

sudo mysql -u root
use mysql;
update user set plugin='' where User='root';
flush privileges;
exit;
Related Question