full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

MySQL integration

Open Periscope123 opened this issue 3 years ago • 6 comments

Hello!

I have a question about MySQL integration. Right now we can generate a starter pack with PSQL config. How can I change it so my app will use MySQL?

PGAdmin for PostgreSQL database, you can modify it to use PHPMyAdmin and MySQL easily.

Is there any example project with MySQL integration?

Periscope123 avatar Aug 19 '21 21:08 Periscope123

Yes, I also need to know how to do this and also in stead of just mysql also with mssql I think this project would benaffit significantly with a little documentation explaining how to wire up other native (not docker) databases. I have tried replacing “engine = create_engine(settings.SQLALCHEMY_DATABASE_URI, pool_pre_ping=True)” With “engine = create_engine("mysql+mysqlconnector://root:[email protected]:3306/motest")”

But this doesn’t allow the stack to start.

Help would be much appreciated.

mythral0 avatar Sep 05 '21 08:09 mythral0

Yes, I also need to know how to do this and also in stead of just mysql also with mssql I think this project would benaffit significantly with a little documentation explaining how to wire up other native (not docker) databases. I have tried replacing “engine = create_engine(settings.SQLALCHEMY_DATABASE_URI, pool_pre_ping=True)” With “engine = create_engine("mysql+mysqlconnector://root:[email protected]:3306/motest")”

But this doesn’t allow the stack to start.

Help would be much appreciated.

mythral0 avatar Sep 05 '21 08:09 mythral0

I'm using pymysql and it work well “engine = create_engine("mysql+pymysql://user:passwd@host:prot/dbname")”

phamngocquy avatar Nov 30 '21 10:11 phamngocquy

May be this repo could help you

vuongtlt13 avatar Apr 09 '22 10:04 vuongtlt13

@vuongtlt13 @tiangolo I tried installing google-cloud-storage and I couldn't install it using poetry but pip does it in the system but it's not accessible by the docker project

nzivo avatar Jun 23 '22 17:06 nzivo

@vuongtlt13 @tiangolo I tried installing google-cloud-storage and I couldn't install it using poetry but pip does it in the system but it's not accessible by the docker project

I ran it successfully after adding RUN bash -c "pip install google-cloud-storage" in backend.dockerfile and celeryworker.dockerfile immediately after the project.toml COPY command

nzivo avatar Jun 24 '22 11:06 nzivo