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

MySQL connection problem #13

Closed andraskiss1 closed 6 years ago

andraskiss1 commented 7 years ago

Hi, first of all thanks for the great container :) My problem is I cant connect to the database via Sequel Pro. Please tell me how can I open the mysql port to connect. Thanks

tomsik68 commented 7 years ago

Hi, I'm glad you like the container :)

Here's the example command from readme: docker run --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/www tomsik68/xampp

You can easily adapt it to expose MySQL database. The server is running on standard port 3306 in the container. You might want to set it to different port - in this example, it is 41063. docker run --name myXampp -p 41061:22 -p 41062:80 -p 41063:3306 -d -v ~/my_web_pages:/www tomsik68/xampp. Once you have that running, you should be able to connect to database at localhost using port 41063.

andraskiss1 commented 6 years ago

Thank you, its working well now :)

andraskiss1 commented 6 years ago

Is it possible to copy my web content inside the container? I would like to make a cloud site with Azure and Docker. Thank you

tomsik68 commented 6 years ago

If you included -p 41061:22 in the docker run command, the most straightforward solution would be to login as root(password root) via ssh at port 41061 and copy your files to container's /www folder.

I don't know much about Azure, so they might offer something like SSH or FTP to the machine, which might be useful, too.

andraskiss1 commented 6 years ago

Thank you, its working now :)