Does mysql configuration options accepts - instead of _?
https://dev.mysql.com/doc/refman/8.0/en/command-line-options.html says:


  Within option names, dash (-) and underscore (_) may be used
  interchangeably. For example, --skip-grant-tables and
  --skip_grant_tables are equivalent. (However, the leading dashes cannot be given as underscores.)


This applies to options when you use them in option files, as well as command-line flags.

However, when using option variables in SQL queries, like in SET GLOBAL read_only=ON, you must use underscores only. Even putting the variable in back-ticks doesn't allow you to use hyphens.

mysql&gt; set global `read_only`=ON;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; set global `read-only`=ON;
ERROR 1193 (HY000): Unknown system variable 'read-only'

mysql&gt; select @@`read_only`;
+---------------+
| @@`read_only` |
+---------------+
|             1 |
+---------------+
1 row in set (0.01 sec)

mysql&gt; select @@`read-only`;
ERROR 1193 (HY000): Unknown system variable 'read-only'