$ sudo mariadb -uroot
> alter user root@localhost identified by ”;
> flush privileges;
> exit
$ mariadb -uroot
Or if version < 10.2 try
$ sudo mariadb
> UPDATE mysql.user SET plugin = ‘mysql_native_password’ WHERE user = ‘root’;
> flush privileges;
> exit