Cannot connect to Azure Postgresql with drush in Drupal

Viewed 25

Hi I cannot login to Azure postgresql from docker container with Drupal. I am trying to run simple command

> ./bin/drush si --site-name="XXXX"--db-url=$DATABASE_DRIVER://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST:$DATABASE_PORT/$DATABASE_NAME --yes ;

But I am unable to connect to Azure PgSql due to thei weird connection string which absouletly needs to give usernae@host, instead of just username. I was able to overcome this in other tools like pgloader or psql by using '%40' or '@@' instead of '@', but here in drupal I am stuck.

If i use anything, like original username@host, username%40host, "username%40host", etc. I get this:

Failed to drop or create the database. Do it yourself before installing. psql: error: FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in username@hostname for mat. FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in username@hostname format

If I use username@@host i get:

[warning] Failed to drop or create the database. Do it yourself before installing. psql: error: FATAL: password authentication failed for user "dbadmin@" password retrieved from file "/tmp/drush_ITT00N" FATAL: password authentication failed for user "dbadmin@" password retrieved from file "/tmp/drush_ITT00N"

which means he takes usenrame as username@ and thinks that string after is host.

How can I fix it?

0 Answers
Related