# System Variable Name vs Option-File Format

**URL:** <https://forums.percona.com/t/system-variable-name-vs-option-file-format/3190>\
**Category:** Other MySQL® Questions\
**Created:** [January 9, 2014, 3:01pm UTC](https://forums.percona.com/t/system-variable-name-vs-option-file-format/3190 "2014-01-09T15:01:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Rahrer](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/david_rahrer/32/986_2.png) [@David\_Rahrer](https://forums.percona.com/u/David_Rahrer)\
**Post date:** [January 9, 2014, 3:01pm UTC](https://forums.percona.com/t/system-variable-name-vs-option-file-format/3190/1 "2014-01-09T15:01:56Z")

</div>

I’ve run into this a lot and I would appreciate some clarification. For instance, in the default my.cnf file, there is this option:

```auto
default_storage_engine = InnoDB

```

Then in the config I got from the Percona Wizard, there is this:

```auto
default-storage-engine = InnoDB

```

Now in this instance, the [5.x docs](http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_default-storage-engine) don’t show the first one, but for other names where I run into the same “dashes vs underscores” confusion, it lists the one with dashes as the Option-File Format and the underscores as the System Variable Name. I find them mixed all the time and just don’t understand. I want to be consistent and correct. What is the difference between System Variable Name and Option-File Format in this context, and what should I be using in my.cnf? I could just assume the latter is correct and stick with that but then why is the default file using the former? And in this case, it’s using a format that isn’t even in the docs. If someone could clear this up, I would really appreciate it.

---

<div class="post-metadata">

**Author:** ![niljoshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/niljoshi/32/16889_2.png) [@niljoshi](https://forums.percona.com/u/niljoshi)\
**Post date:** [January 16, 2014, 2:40am UTC](https://forums.percona.com/t/system-variable-name-vs-option-file-format/3190/2 "2014-01-16T02:40:00Z")

</div>

Hi David,

There is already a bug opened for this issue. [URL][MySQL Bugs: #55288: Use of the underscore or hyphen for variables and options is confusing](http://bugs.mysql.com/bug.php?id=55288%5B/URL%5D)  
There should some specific documentation for that OR they should keep any one out of “\_” and “-” but as still it’s in feature requests for Oracle, we can’t do anything for that.  
But I would suggest its better to use \_ rather then -. Because you can use \_ everywhere, including my.cnf and command line . But - is not working with SET like

mysql\> SET global default\_storage\_engine = InnoDB;  
Query OK, 0 rows affected (0.01 sec)

mysql\> SET global default-storage-engine = InnoDB;  
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-storage-engine = InnoDB’ at line 1  
mysql\>

You can use \_ with server variables too. Check here comment by “[1 Nov 2008 20:16] Sveta Smirnova” [URL][MySQL Bugs: #40368: mysqld\_safe not honouring underscore same as dash on server options](http://bugs.mysql.com/bug.php?id=40368%5B/URL%5D)

---

<div class="post-metadata">

**Author:** ![David\_Rahrer](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/david_rahrer/32/986_2.png) [@David\_Rahrer](https://forums.percona.com/u/David_Rahrer)\
**Post date:** [January 16, 2014, 9:15am UTC](https://forums.percona.com/t/system-variable-name-vs-option-file-format/3190/3 "2014-01-16T09:15:19Z")

</div>

Excellent, thanks much niljoshi. I hope they get it sorted out but I will go with “\_” to keep my work consistent.
