Docker xwiki-mysql-tomcat (14.2): mysql and utf-8

Dear Forum,

Im testing migration from xwiki 12.4 to the current docker mysql-tomcat-lts pulled from github (version 14.2). After issues with importing XAR I note that the db (mysql) does not get configured to use utf-8 for the xwiki db, but still uses latin-1 encoding Hence the import errors.

The /etc/mysql/conf.d/xwiki.cnf is correctly mounted on the container. Investigating the running db-container I can see that /var/lib/mysql/xwiki/db.opt says latin-1, and not utf-8, which is confirmed by querying the database as well.

I guess I can get around this myself, but thought it should be mentioned.

Thanks
N

Hi. We don’t provide such a docker image. Do you have a link to what image you’re referring to?

In any case if you’re using docker we don’t provide any image for the database part so it’s up to you to use and configure your DB correctly.

Could it be that you’re mixing docker with apt?

Hi!
:smiley: It’s not apt.

I pulled the source from GitHub - xwiki/xwiki-docker: Dockerfile to build and run XWiki on docker and basically just run docker-compose in the “14/mysql-tomcat” sub-directory and try to make sure that the volumes mount correctly.

If I find what errs, I will update here. (As always, the probability that I missed something is higher than infinitesimal…)

I have to correct myself above: It is not the LTS! Its built from Dockerfile with version set to 14.2.

Thanks for all your efforts!
N

One issue I have is that when running docker-compose on a clean clone from github, the first time the db-server gets permission denied on the init.sql file. A renewed start attempt does not show this, but then I guess it is too late and the settings did not apply.

I think this solves it.

I suppose it could depend on docker/podman version OS. In my case, the problem seemed to be that the mysql/init.sql and mysql/xwiki.cnf had 640 permissions when cloned from github. This prevented the container read access to these files and mysql was not initialized correctly. So the solution was simply:

chmod -R 0644 ./mysql

Important to do this before the first start of the mysql container, since the initialization is done only once.