Trying to get mailman3 in docker working with external Mysql database
Our database group has created the database with (charset=utf8mb4&use_unicode=1) and a user
For my docker-compose.yaml I will only have two container sections
mailman-core mailman-web
which should have these database variables set under each:
-DATABASE_URL=mysql+pymysql://[database_user]:[database_password]@[database.server.ip]:[databseport]/[database_name]
- DATABASE_TYPE=mysql
- DATABASE_CLASS=mailman.database.mysql.MySQLDatabase
Are these all correct? in looking at documentation should it be:
DATABASE_URL=mysql+pymysql://[database_user]:[database_password]@[database.server.ip]:[databseport]/[database_name]?charset=utf8mb4&use_unicode=1
Or/and should I also use?
DATABASE_URL=mysql+pymysql://....
or
DATABASE_URL=mysql://...
or
DATABASE_URL=pymysql://....
Do I have to install pymysql? or is it installed in the dock images?
Do I have to run any other commands on the database first? I assume mailman does everything it needs for the database at first launch?
Bob, For mailman-core, I use this:
environment: - DATABASE_URL=mysql+pymysql://mailman:[realstrongpassword]@database/mailmandb ?charset=utf8mb4&use_unicode=1 - DATABASE_TYPE=mysql - DATABASE_CLASS=mailman.database.mysql.MySQLDatabase - HYPERKITTY_API_KEY=[realstrongkey] - MTA=postfix
For mailman-web, I use this:
environment: - DATABASE_URL=mysql://mailman:[realstrongpassword]@database/mailmandb - DATABASE_TYPE=mysql
Pymysql should be installed in the container(s) via the image. You
shouldn't have to do it. If your environment variables are complete and correct in docker-compose.yaml, you should have to interactively configure anything within either container. It is all done at creation/boot time.
You might want to run "docker logs mailman-core" after starting the
container. Just to see what it is saying about the database connection. In my case, it wasn't working, due to an invalid character in the password. You'd never know unless you look at those logs.
-----Original Message----- From: bob B <bader@cchmc.org> Sent: Saturday, October 9, 2021 1:45 AM To: mailman-users@mailman3.org Subject: [MM3-users] Trying to get mailman3 in docker working with external Mysql database
Our database group has created the database with (charset=utf8mb4&use_unicode=1) and a user
For my docker-compose.yaml I will only have two container sections
mailman-core mailman-web
which should have these database variables set under each:
-DATABASE_URL=mysql+pymysql://[database_user]:[database_password]@[database. server.ip]:[databseport]/[database_name]
- DATABASE_TYPE=mysql
- DATABASE_CLASS=mailman.database.mysql.MySQLDatabase
Are these all correct? in looking at documentation should it be:
DATABASE_URL=mysql+pymysql://[database_user]:[database_password]@[database.s erver.ip]:[databseport]/[database_name]?charset=utf8mb4&use_unicode=1
Or/and should I also use?
DATABASE_URL=mysql+pymysql://....
or
DATABASE_URL=mysql://...
or
DATABASE_URL=pymysql://....
Do I have to install pymysql? or is it installed in the dock images?
Do I have to run any other commands on the database first? I assume mailman does everything it needs for the database at first launch?
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Thanks that is working.
Actually I think it was always working form initial setup.
I tore down and removed the docker environment (using local database image) and then re-setup with external database, However the website was not loading. I had "assumed" it was because I was switching to external database, but the logs showed nothing.
Turns out my nginx service was down on the host.
participants (2)
-
bob B
-
matthew@alberti.us