My local environment is:
with installed MySQL 5.7
sudo apt-get install mysql-common mysql-se
The mysql command by default uses UNIX sockets to connect to MySQL.
If you're using MariaDB, you need to load the Unix Socket Authentication Plugin on the server side.
You can do it by editing the [mysqld] configuration like this:
[mysqld]
plugin-load-add = auth_socket.so
Depending on distribution, the config file is usually located at /etc/mysql/ or /usr/local/etc/mysql/