The WhatsApp Business API client requires MySQL to store data.
This document covers:
If you are using our AWS template, or are already on MySQL, and can ignore this section.
Switching to MySQL requires stopping your WhatsApp Business API client, so plan for some downtime during this transition. Make sure you have the latest files and installation scripts from the Installation guide.
mysql.conf
with your MySQL credentials. Use the mysql.conf.DEFAULT
file included in the installation scripts as a guide on what to provide; the values are all placeholders and need to be changed. The login for MySQL must have create database permissions because the WhatsApp Business API client will create the database and tables automatically.mysql.conf
file you created in the previous step. It is recommended you upgrade and use the script for this step. If you do not want to upgrade at this time, you can set the version
parameter to be your current WhatsApp Business API client version.docker restart <your_container_id>
You must set the database settings through environment variables when launching Docker images for both the Coreapp and Webapp.
If you used the scripts to install the WhatsApp Business API Client rather than the Docker Compose method, you must set the database settings through environment variables when launching Docker images for both the Coreapp and Webapp.
Database Setting | Environment Variable |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Using a console, save your environment variables in a file:
cat env.list WA_DB_ENGINE=MYSQL WA_DB_HOSTNAME=127.0.0.1 WA_DB_PORT=3306 WA_DB_USERNAME=root WA_DB_PASSWORD=<your_password> WA_DB_CONNECTION_OPTION="SSL_KEY=/usr/local/ssl/client-key.pem;SSL_CERT=/usr/local/ssl/client-cert.pem;SSL_CA=/usr/local/ssl/ca.pem" WA_DB_NAME_PREFIX=<your_prefix>
Pass the file you created to Docker:
docker run -d --name wacore2.18.26 --env-file ./env.list -v whatsappData:/usr/local/waent/data -v whatsappMedia:/usr/local/wamedia whatsapp/coreapp:v2.18.26