[Python] Why is my database userid resolving to localhost in a Docker container? [closed]

Discussão em 'Python' iniciado por Stack, Março 28, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Python program that accesses a mariadb database on a server using SQLAlchemy, and it works great when executed from the command line in my Fedora system.

    However, when I take that exact same code and run it within a Debian Docker container, the user name in the SQLAlchemy connection string is no longer "userid" but "userid@hostname.fritz.box", which of course is incorrect and I can't login to the database.

    So, why is SQLAlchemy (or the mariadb driver?) trying to resolve the userid to the local environment instead of just pumping it through to the database?

    The only thing that is really different between the command line execution and the docker execution, is that there is a different mariadb environment that is built from the poetry install inside the Debian container.

    Continue reading...

Compartilhe esta Página