In MySQL some configuration options use _
and some use -
. Is there any way to easily identify when to use one versus the other?.
MySQL configuration: when to use hyphen and when to use underscore
Asked Answered
When you are about to change a configuration option, you are bound to have it in front of your eyes already, aren't you? Not sure what sense this would make? –
Polyethylene
Use underscore ( _ ) in order not to mix up command line flags of MySQL server . –
Cabot
@Polyethylene at least, if every option follows a unique pattern, it will be helpful, Agree? –
Terpineol
No.
It's just one of those things that happen when a team of people design a product.
Different conventions get used leading to inconsistency.
See here: http://dev.mysql.com/doc/refman/5.5/en/mysqld-option-tables.html
And scroll to the options starting with ssl
, you'll see what I mean.
It's even inconsistent in the doc: At Time Zones we find
default-time-zone
and default_time_zone
. Will it take both? Will it take both in the config file and the command line? Will it warn if not or silently ignore? This is sloppy in so many ways and causes unnecessary confusion. I remember having logged a bug to fix this about 20 years ago. Grrr. –
Fluctuant Testing reveals that both underscored and dashed option work when read from config files and that unknown options will cause the server to not start.
default_time_zone
, default_time-zone
, default-time-zone
are all recognized. (MariaDB 10.2.13) EXCELLENT!. –
Fluctuant According to the suggestion in the mysql bug report discussing the confusing state of the mysql docs:
- The
my.cnf
and command line options you can use either_
or-
within the option name.- Server variables are
_
only when working with the MySQL client (modifying from SET for example).
In summary, you can use _
and -
interchangeably within a config file.
© 2022 - 2024 — McMap. All rights reserved.