By default MariaDB use the unix_socket
plugin to authenticate users.
But it's easier to use mysql_native_password
for dev (and only for dev because it's way less secure).
Get root access
sudo su
Connect to mysql
mysql
Run this query
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
SET PASSWORD = PASSWORD('foo');
And then
flush privileges;
Enjoy !
Works with Mariadb 10.3 perfect. thanks