Closed lforite closed 3 years ago
Hi Louis,
Can you please elaborate why you need to use different DB names? Please note that you can prefix DB names using the variable WA_DB_NAME_PREFIX
as documented https://developers.facebook.com/docs/whatsapp/guides/mysql.
Hey I missed that part of the documentation, thanks for pointing it out ! Does it also work for PG ?
I just tried and it looks like it cannot parse db names with hyphens.
The following query works in PG: CREATE DATABASE "test-db";
but this one fails CREATE DATABASE test-db;
. Now, trying to use prefix and postgres, we get the following error :
Failed to create web db or store db settings to database.yml file.
An exception occurred while executing 'CREATE DATABASE mydb-multiwaweb':
SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "-"
LINE 1: CREATE DATABASE mydb-multiwaweb
Could you please add quotes around the DB name so it is compatible with PG ? Thanks a lot
Hi @lforite
Did you set WA_DB_ENGINE
to be PGSQL
? Asking just in case you missed it.
Can you try setting WA_DB_HOSTNAME
to "test-db" and see if it works? Will this be sufficient for you?
Sorry if I seem ignorant, but I can't figure it out how this works. How do I tell the program what is the database name? I did the instructions as told and set the database server but it is stuck into: Database is not up yet - sleeping I guess that's because it doesn't know which database to connect in the server? And why DB_HOSTNAME is supposed to be database name? If I put the database name there I get, nc: getaddrinfo: Name or service not known , but if I put there localhost it works, but it is stuck into Database is not up yet - sleeping
If you may help, I'l be very glad.
Also, I'm using Postgres, and set PGSQL as engine
@jdc-developer You needn't set your db name, you should set DB hostname as the value of WA_DB_HOSTNAME
.
The API client will create a list of DBs for you on the DB host during initial setup.
Also make sure that WA_DB_USERNAME
is a db user that has highest privileges.
We are looking into deploying WhatsApp Business API but we noticed that the DB name cannot be set through envionment variables, even though it's possible all the other variables such as
WA_DB_ENGINE
,WA_DB_HOSTNAME
,...
.Would it be possible to add the support for the
WA_DB_NAME
environment variable ?