Check out example codes for "check mysql password with docker container magento 2". It will help you in understanding the concepts better.

Code Example 1

docker-compose run --rm deploy mysql -umagento2 -p

Learn ReactJs, React Native from akashmittal.com