Mysqltest: unknown variable 'default-character-set=utf8mb4' [sql, docker]

Hi there.

I’m trying to run a mysqltest script in a MySQL instance in Docker.

When I run the script (on my terminal/shell) that contains the mysqltest, it shows this:

mysqltest: unknown variable 'default-character-set=utf8mb4'

In my database, the character sets I have are utf8 or latin1. I don’t have utf8mb4.

I’ve tried adding this line in my docker compose .yml file:

  command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci  

And this changes the database character set from latin1 to utf8mb4 but I’m still facing the same error. I’m not sure how to fix this?

I’m using Ubuntu in WSL2 in my computer. I have mariadb-test installed.