In Debian 9 MariaDB is using the UNIX auth_socket plugin by default. This basically means that database users will be “auth” by the system user credentials.
# sudo mysql -u root # I had to use "sudo" since is new installation
mysql> USE mysql; mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root'; mysql> FLUSH PRIVILEGES; mysql> exit;
# service mysql restart
Dont forget to set a root password