![]() ![]() I know there are many questions like this one, but all of them involve docker-compose. Right now it runs on localhost on port 3306 (according to docker ps), but when I try to access 127.0.0.1:3306 in Sequel Pro I'm getting: Unable to connect to host 127.0.0.1, or the request timed out.Īlso, I'm not sure what username I should use with this container (I've tried admin/root/empty) My question is - how could I setup this container so it gets its own port, and IP and I can use it anywhere within my local network, without docker-compose? But I'm not good enough with MySQL to manage it through Terminal. on the docker compose I did: ports: - '8080:3306 the thing is the host IP. However, when I want to connect to that database and I go to workbench for example. If I launch my container and get into the bash and check MySQL I can do any operation I want. I'm able to login to the container using docker exec -it mysql-experiment bash. I did a docker compose which has a MySQL image inside. docker run -name mymysql -e MYSQLROOTPASSWORDmypw -e MYSQLDATABASEbullshit -p 3306:3306 -d mysql As you set manually a port mapping from containers port 3306 to the same port of your Boot2docker VM, you should can access to MySQL using the IP of the Boot2docker instance, typically 192.168.59. When I run docker ps I can see mysql-experiment is running. I pulled already then run it like this: docker run -name mysql-experiment -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7.21 ![]() ![]() Some of these projects also run Docker, some do not, the ones running Docker have docker-compose.yml in repos so I cannot change this file, for the others I don't want to use Docker at all (excepting the base container). I'm new to Docker and might be confusing things but let's say I have multiple projects and I want to use the same docker MySQL database with them. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |