Latest Mariadb is using unix_socket plugin for root login Authentication Plugin - Unix Socket - MariaDB Knowledge Base
following command results in access denied
mysql -u root -p
with new plugin use command:
sudo mysql -u root
at the prompt remove the plugin and change root password if necessary:
use mysql;
update user set plugin='' where User='root';
flush privileges;
exit
For more on unix_socket plugin related error :
http://www.versatilewebsolutions.com/blog/2015/05/dealing-with-mariadb-plugin-unixsocket-is-not-loaded.html