I recently installed Docker in Ubuntu 18.04 and with that, I have downloaded the mariadb image like this
docker run --name mariadb \
-p 3306:3306 \
-v /opt/mariadb_data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=lopaz \
--restart always \
-d mariadb:10.1
this is pretty cool method that I used to download from the official mariadb image and it's working well. What my question is that I want to use to login to the MariaDB ? when I type
mysql -h <myhost> -u root -p
MySQL or MariaDB not found on my local Ubuntu machine. What happened ? how my pc knows that I installed mariadb using docker? then I installed mysql client app then only I can use mysql
commands on my local pc! please give me a clarification about why it happens when install using docker?