I'd like to configure the ft_min_word_len and ft_stopword_file settings in my MySQL container. I need shorter words to be indexed as fulltext, and I don't want to use a stopword file at all.
I tried to set the variables with arguments in my docker-compose.yml:
version: "3.4"
services:
ata-mysql:
restart: unless-stopped
image: mysql:5.7.22
command:
- "mysqld"
- "--innodb_buffer_pool_size=400M"
- "--innodb_buffer_pool_instances=1"
- "--ft_min_word_len=1"
- "--ft_stopword_file=''"
But after a restart, it looks like MySQL hasn't picked up this configuration:
mysql> show variables like 'ft_min_word_len';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| ft_min_word_len | 4 |
+-----------------+-------+
1 row in set (0.00 sec)
mysql> show variables like 'ft_stopword_file';
+------------------+------------+
| Variable_name | Value |
+------------------+------------+
| ft_stopword_file | (built-in) |
+------------------+------------+
1 row in set (0.01 sec)
Is it possible to set those variables through an argument? I'd like to avoid creating a separate Dockerfile for this kind of configuration.
my.cnfin yourdocker-compose.yml