tomsik68 / docker-xampp

Dockerfile to build an image containing XAMPP(MySQL + PHP + PHPMyAdmin) running on Debian system with SSH server
https://hub.docker.com/r/tomsik68/xampp/
MIT License
198 stars 109 forks source link

How can I access the mysql from shell? #10

Closed ratul0 closed 7 years ago

ratul0 commented 7 years ago

Hi @tomsik68 can you please tell me how to access docker-xampp 's mysql from the shell? It would be a great help.

tomsik68 commented 7 years ago

Hey, you should be able to use mysql cli utility on the guest machine to do so. The simplest way to get on the guest machine is to run docker exec -ti <container name> bash on your host.

If you want to access mysql from host machine, you can forward mysql's default port(I think 3306) from the container and use mysql to connect to it.

ratul0 commented 7 years ago

@tomsik68 I followed your instruction, but it says bash: mysql: command not found

tomsik68 commented 7 years ago

Hmm you can try installing mysql in the container then apt-get -y install mysql

Edit: future readers, see comment below for answer!

tirjok commented 7 years ago

@ratulcse27 Please run in your bash export PATH=/opt/lampp/bin:$PATH

Then you will get all of this service