If you have lightsail instance, it is super easy to connect to mariadb (or mysql) installed with bitnami.

First take the password by cating

cat bitnami_application_password

Then connect

mysql --host localhost --user root --port 3306 -p

The above command could be deprecated, use with mariadb

/opt/bitnami/mariadb/bin/mariadb  --host localhost --user root --port 3306 -p

You dont need phpmyadmin. This is the rightway to avoid error cannot connect to socket.