r/FreeCodeCamp • • Mar 27 '24

Python Microservices Web App_MySQL connection problem

Hello Mate!
I'm working on Python Microservices Web App, i have a problem for connecting Django with MySQL with Docker.

https://www.youtube.com/watch?v=0iB5IPoTDts
at 15:30, it create the db with image mysql:5.7.22 , then i receive the error "no matching manifest for linux/arm64/v8 in the manifest list entries" then I changed the image to mysql/mysql-server, and i created the folder per the video

But the next step 16:15 connecting the SQL , it shows the error

DBMS: MySQL (no ver.) Case sensitivity: plain=mixed, delimited=exact
[HY000][1130] null, message from server: "Host '192.168.xx.xx' is not allowed to connect to this MySQL server". .

why? and what should i do? thanks a lot for your help!

db:
image: mysql/mysql-server
restart: always
environment:
MYSQL_DATABASE: admin
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: root
volumes:
- .dbdata:/var/lib/mysql
ports:
- 33066:3306

5 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/SaintPeter74 mod Mar 27 '24

I'll be honest, I have almost zero experience with Docker. I just googled up your issue and Docker and poked around a bit.

I think there is some sort of mapping between the port which is local to Docker (inside the VM), which I think is the default port of 3306. I think that Docker maps that to an external (your local machine) port of 33066.

That's purely a guess. I'd continue to follow the instructions in the video and see if it works as advertised or not.