I should clarify a bit. That connection string I mentioned in the previous post is in the docker-compose.yaml file for the docker-mailman containers. For web, it seems the settings.py file for the mailman-web container is configured to parse connection string, but there isn't (I don't think) any provision to set additional options, such as the encoding. So there doesn't appear to be a straightforward way, using the container yaml approach, to pass the 'OPTIONS' for the encoding. It does however look like it is possible to override the whole database connection settings using settings_local.py, but unsure. That would I think be the way to do it, setting the whole database configuration settings per https://gitlab.com/mailman/mailman-suite/-/blob/master/mailman-suite_project /settings.py#L156 in the settings_local.py file.
For core, the connection string seems to accept a tailing "?charset=utf8&use_unicode=1" per https://mailman.readthedocs.io/en/stable/src/mailman/docs/database.html So for core, maybe just updating the connection string to include "?charset=utfmb4&use_unicode=1" will just work? The link lists utf8 as the recommend encoding... maybe that should be updated?
I realize this may be drifting more towards concerning the docker container setup vs. non-containerized core and web. But either way, these seem to be mysql specific caveats that I've certainly missed. Hopefully this helps someone else.
Seems the takeaway is that, for mysql databases only, the use of utf8mb4 is recommended, and it needs to be explicitly identified in the database settings for BOTH core and web, and probably somehow at database creation time?
Now to see what the best procedure is to put these configuration changes in place, and also update the database?
- Matt Alberti
-----Original Message----- From: Mark Sapiro <mark@msapiro.net> Sent: Wednesday, December 9, 2020 9:35 PM To: mailman-users@mailman3.org Subject: [MM3-users] Re: Hyperkitty Recommended mySQL Database Setup & Archive Importing
On 12/9/20 6:06 PM, matthew@alberti.us wrote:
Thanks Mark. Also, just to confirm, should the database connection string also be updated? In both the core and web configuration, I have something like:
DATABASE_URL=mysql+pymysql://mailman:password@database/mailmandb
Note the trailing UTF-8 encoding stuff isn't there. Should we be specifying utf8mb4 there as well?
In the mailman.cfg database section, you probably want
url: mysql+pymysql://myuser:mypassword@mymysqlhost/mailman?charset=utf8mb4&us mysql+e_unicode=1
I don't know why you would have a DATABASE_URL setting in the web configuration. Exactly where is this? I don't think it would be meaningful in any Django settings.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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/