Sernior
Sernior4w ago

Trouble connecting to mysql locally

Hello, I am having some problems with self-hosting a local mysql convex for a client who wants everything local. I am quite new to docker and I do not understand what is going on exactly I did follow the guide but even after I did setup my mysql server created a user I wish to use for the docker and set the enviromental variable MYSQL_URL correctly I get these errors all I did was exactly what the guide suggests:
mysql -e "CREATE DATABASE convex_self_hosted;" export MYSQL_URL=mysql://<your-username>@host.docker.internal:3306 export DO_NOT_REQUIRE_SSL=1 docker compose up
No description
3 Replies
Emma
Emma4w ago
Hey! does it work if you use docker compose?
Sernior
SerniorOP4w ago
no but I think the problem was that I was using mariaDB for mysql I made another docker with mysql 8 made a docker network and it worked I am not sure if it is a good idea or not to have mysql in a separate docker I will surely try more tomorrow and let you know I am not very familiar with docker so I am not sure if the having 3 docker 1 for the dashboard 1 for the backend and 1 for the mysql8 is a good solution compared to what your guide suggest to instead having mysql on the local machine and then 2 dockers
Emma
Emma4w ago
sounds reasonable to have a docker container for your mysql cluster for simulating your production setup, or running mysql locally if you're mainly using convex locally.

Did you find this page helpful?