This solves my problem in the way i can understand, being aware that md5 is less ideal an encryption method than scram-sha-256 but recompile the package to meet the requirement of psycopg2 is a pain in a**. Then you can run a test of DB connection with psycopg2, as well as sqlalchemy. This step will flush a new hash for the password under md5 to replace the existing scram hash of the user password. Reset password for user account (within the psql consol). Reload (under the psql console): SELECT pg_reload_conf() Ĭheck Encryption: SHOW password_encryption Login with postgres id: sudo -u postgres sql This command depends on your server setup as well. This is bcos the hash of password in DB still uses scram encryption. After this step 1 you may (most likely) continue to have the issue of authentication error. Use vi (or other editor) to replace scram-sha-256 with md5 in the file nf and post_hba.conf location of the files depends on your local set up.RUN pip3 install psycopg2-binary -no-binary psycopg2-binary RUN apt update -y & apt install -y build-essential libpq-dev ![]() For this, add the following commands to the dockerfile. The second solution is to build the psycopg2 file and install libq and other dependencies.Change base image name to 'python:3.9.6-alpine3.14' I used 'python:3.9-slim-buster' at docker and I've got error. If you're getting an error, you'll probably see a number like 90xxx here. If you want to know your libq version used in your docker-image, you can do the following, respectively. It is explained with examples in the answer given here. I didn't try local, solutions are for docker container.Īccording to the main image we defined at the beginning of the Dockerfile, our libq versions may differ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |