<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="option-file-options">
      </a>
      6.2.2.3 Command-Line Options that Affect Option-File Handling
     </h4>
    </div>
   </div>
  </div>
  <p>
   Most MySQL programs that support option files handle the
        following options. Because these options affect option-file
        handling, they must be given on the command line and not in an
        option file. To work properly, each of these options must be
        given before other options, with these exceptions:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="option-file-options.html#option_general_print-defaults">
       <code class="option">
        --print-defaults
       </code>
      </a>
      may be used
            immediately after
      <a class="link" href="option-file-options.html#option_general_defaults-file">
       <code class="option">
        --defaults-file
       </code>
      </a>
      ,
      <a class="link" href="option-file-options.html#option_general_defaults-extra-file">
       <code class="option">
        --defaults-extra-file
       </code>
      </a>
      ,
      <a class="link" href="option-file-options.html#option_general_login-path">
       <code class="option">
        --login-path
       </code>
      </a>
      , or
      <a class="link" href="option-file-options.html#option_general_no-login-paths">
       <code class="option">
        --no-login-paths
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      On Windows, if the server is started with the
      <a class="link" href="option-file-options.html#option_general_defaults-file">
       <code class="option">
        --defaults-file
       </code>
      </a>
      and
      <a class="link" href="server-options.html#option_mysqld_install">
       <code class="option">
        --install
       </code>
      </a>
      options,
      <a class="link" href="server-options.html#option_mysqld_install">
       <code class="option">
        --install
       </code>
      </a>
      must be first. See
      <a class="xref" href="windows-start-service.html" title="2.3.3.8 Starting MySQL as a Windows Service">
       Section 2.3.3.8, “Starting MySQL as a Windows Service”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   When specifying file names as option values, avoid the use of
        the
   <code class="literal">
    ~
   </code>
   shell metacharacter because it might
        not be interpreted as you expect.
  </p>
  <div class="table">
   <a name="idm46045323885584">
   </a>
   <p class="title">
    <b>
     Table 6.3 Option File Option Summary
    </b>
   </p>
   <div class="table-contents">
    <table frame="box" rules="all" summary="Command-line options available for handling option files.">
     <colgroup>
      <col style="width: 35%"/>
      <col style="width: 64%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Option Name
       </th>
       <th>
        Description
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        <a class="link" href="option-file-options.html#option_general_defaults-extra-file">
         --defaults-extra-file
        </a>
       </td>
       <td>
        Read named option file in addition to usual option files
       </td>
      </tr>
      <tr>
       <td>
        <a class="link" href="option-file-options.html#option_general_defaults-file">
         --defaults-file
        </a>
       </td>
       <td>
        Read only named option file
       </td>
      </tr>
      <tr>
       <td>
        <a class="link" href="option-file-options.html#option_general_defaults-group-suffix">
         --defaults-group-suffix
        </a>
       </td>
       <td>
        Option group suffix value
       </td>
      </tr>
      <tr>
       <td>
        <a class="link" href="option-file-options.html#option_general_login-path">
         --login-path
        </a>
       </td>
       <td>
        Read login path options from .mylogin.cnf
       </td>
      </tr>
      <tr>
       <td>
        <a class="link" href="option-file-options.html#option_general_no-defaults">
         --no-defaults
        </a>
       </td>
       <td>
        Read no option files
       </td>
      </tr>
      <tr>
       <td>
        <a class="link" href="option-file-options.html#option_general_no-login-paths">
         --no-login-paths
        </a>
       </td>
       <td>
        Do not read options from login path file
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a name="option_general_defaults-extra-file">
      </a>
      <a class="link" href="option-file-options.html#option_general_defaults-extra-file">
       <code class="option">
        --defaults-extra-file=
        <em class="replaceable">
         <code>
          file_name
         </code>
        </em>
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for defaults-extra-file">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --defaults-extra-file=filename
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          File name
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           [none]
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323850704">
     </a>
     <p>
      Read this option file after the global option file but (on
            Unix) before the user option file and (on all platforms)
            before the login path file. (For information about the order
            in which option files are used, see
      <a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
       Section 6.2.2.2, “Using Option Files”
      </a>
      .) If the file does not exist
            or is otherwise inaccessible, an error occurs. If
      <em class="replaceable">
       <code>
        file_name
       </code>
      </em>
      is not an absolute path
            name, it is interpreted relative to the current directory.
     </p>
     <p>
      See the introduction to this section regarding constraints
            on the position in which this option may be specified.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="option_general_defaults-file">
      </a>
      <a class="link" href="option-file-options.html#option_general_defaults-file">
       <code class="option">
        --defaults-file=
        <em class="replaceable">
         <code>
          file_name
         </code>
        </em>
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for defaults-file">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --defaults-file=filename
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          File name
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           [none]
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323834576">
     </a>
     <p>
      Read only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
      <em class="replaceable">
       <code>
        file_name
       </code>
      </em>
      is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
     </p>
     <p>
      Exceptions: Even with
      <a class="link" href="option-file-options.html#option_general_defaults-file">
       <code class="option">
        --defaults-file
       </code>
      </a>
      ,
      <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
       <span class="command">
        <strong>
         mysqld
        </strong>
       </span>
      </a>
      reads
      <code class="filename">
       mysqld-auto.cnf
      </code>
      and client programs
            read
      <code class="filename">
       .mylogin.cnf
      </code>
      .
     </p>
     <p>
      See the introduction to this section regarding constraints
            on the position in which this option may be specified.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="option_general_defaults-group-suffix">
      </a>
      <a class="link" href="option-file-options.html#option_general_defaults-group-suffix">
       <code class="option">
        --defaults-group-suffix=
        <em class="replaceable">
         <code>
          str
         </code>
        </em>
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for defaults-group-suffix">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --defaults-group-suffix=string
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          String
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           [none]
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323815216">
     </a>
     <p>
      Read not only the usual option groups, but also groups with
            the usual names and a suffix of
      <em class="replaceable">
       <code>
        str
       </code>
      </em>
      . For example, the
      <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
       <span class="command">
        <strong>
         mysql
        </strong>
       </span>
      </a>
      client normally reads the
      <code class="literal">
       [client]
      </code>
      and
      <code class="literal">
       [mysql]
      </code>
      groups. If this option is given as
      <a class="link" href="option-file-options.html#option_general_defaults-group-suffix">
       <code class="option">
        --defaults-group-suffix=_other
       </code>
      </a>
      ,
      <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
       <span class="command">
        <strong>
         mysql
        </strong>
       </span>
      </a>
      also reads the
      <code class="literal">
       [client_other]
      </code>
      and
      <code class="literal">
       [mysql_other]
      </code>
      groups.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="option_general_login-path">
      </a>
      <a class="link" href="option-file-options.html#option_general_login-path">
       <code class="option">
        --login-path=
        <em class="replaceable">
         <code>
          name
         </code>
        </em>
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for login-path">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --login-path=name
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          String
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           [none]
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323794304">
     </a>
     <p>
      Read options from the named login path in the
      <code class="filename">
       .mylogin.cnf
      </code>
      login path file. A
      <span class="quote">
       “
       <span class="quote">
        login path
       </span>
       ”
      </span>
      is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
      <a class="link" href="mysql-config-editor.html" title="6.6.7 mysql_config_editor — MySQL Configuration Utility">
       <span class="command">
        <strong>
         mysql_config_editor
        </strong>
       </span>
      </a>
      utility. See
      <a class="xref" href="mysql-config-editor.html" title="6.6.7 mysql_config_editor — MySQL Configuration Utility">
       Section 6.6.7, “mysql_config_editor — MySQL Configuration Utility”
      </a>
      .
     </p>
     <p>
      A client program reads the option group corresponding to the
            named login path, in addition to option groups that the
            program reads by default. Consider this command:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa27293409"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysql <span class="token constant">--login-path</span><span class="token attr-value"><span class="token punctuation">=</span>mypath</span></code></pre>
     </div>
     <p>
      By default, the
      <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
       <span class="command">
        <strong>
         mysql
        </strong>
       </span>
      </a>
      client reads the
      <code class="literal">
       [client]
      </code>
      and
      <code class="literal">
       [mysql]
      </code>
      option groups. So for the command shown,
      <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
       <span class="command">
        <strong>
         mysql
        </strong>
       </span>
      </a>
      reads
      <code class="literal">
       [client]
      </code>
      and
      <code class="literal">
       [mysql]
      </code>
      from other option files, and
      <code class="literal">
       [client]
      </code>
      ,
      <code class="literal">
       [mysql]
      </code>
      , and
      <code class="literal">
       [mypath]
      </code>
      from the login path file.
     </p>
     <p>
      Client programs read the login path file even when the
      <a class="link" href="option-file-options.html#option_general_no-defaults">
       <code class="option">
        --no-defaults
       </code>
      </a>
      option is
            used, unless
      <a class="link" href="option-file-options.html#option_general_no-login-paths">
       <code class="option">
        --no-login-paths
       </code>
      </a>
      is set.
     </p>
     <a class="indexterm" name="idm46045323777312">
     </a>
     <a class="indexterm" name="idm46045323776208">
     </a>
     <p>
      To specify an alternate login path file name, set the
      <code class="literal">
       MYSQL_TEST_LOGIN_FILE
      </code>
      environment
            variable.
     </p>
     <p>
      See the introduction to this section regarding constraints
            on the position in which this option may be specified.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="option_general_no-login-paths">
      </a>
      <a class="link" href="option-file-options.html#option_general_no-login-paths">
       <code class="option">
        --no-login-paths
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for no-login-paths">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --no-login-paths
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          Boolean
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           false
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323760784">
     </a>
     <p>
      Skips reading options from the login path file. Client
            programs always read the login path file without this option
            even when the
      <a class="link" href="option-file-options.html#option_general_no-defaults">
       <code class="option">
        --no-defaults
       </code>
      </a>
      option is used.
     </p>
     <p>
      See
      <a class="link" href="option-file-options.html#option_general_login-path">
       <code class="option">
        --login-path
       </code>
      </a>
      for related
            information.
     </p>
     <p>
      See the introduction to this section regarding constraints
            on the position in which this option may be specified.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="option_general_no-defaults">
      </a>
      <a class="link" href="option-file-options.html#option_general_no-defaults">
       <code class="option">
        --no-defaults
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for no-defaults">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --no-defaults
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          Boolean
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           false
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323744016">
     </a>
     <p>
      Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
      <a class="link" href="option-file-options.html#option_general_no-defaults">
       <code class="option">
        --no-defaults
       </code>
      </a>
      can be used to
            prevent them from being read.
     </p>
     <p>
      The exception is that client programs read the
      <code class="filename">
       .mylogin.cnf
      </code>
      login path file, if it
            exists, even when
      <a class="link" href="option-file-options.html#option_general_no-defaults">
       <code class="option">
        --no-defaults
       </code>
      </a>
      is used unless
      <a class="link" href="option-file-options.html#option_general_no-login-paths">
       <code class="option">
        --no-login-paths
       </code>
      </a>
      is set.
            This permits passwords to be specified in a safer way than
            on the command line even if
      <a class="link" href="option-file-options.html#option_general_no-defaults">
       <code class="option">
        --no-defaults
       </code>
      </a>
      is present. To
            create
      <code class="filename">
       .mylogin.cnf
      </code>
      , use the
      <a class="link" href="mysql-config-editor.html" title="6.6.7 mysql_config_editor — MySQL Configuration Utility">
       <span class="command">
        <strong>
         mysql_config_editor
        </strong>
       </span>
      </a>
      utility. See
      <a class="xref" href="mysql-config-editor.html" title="6.6.7 mysql_config_editor — MySQL Configuration Utility">
       Section 6.6.7, “mysql_config_editor — MySQL Configuration Utility”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="option_general_print-defaults">
      </a>
      <a class="link" href="option-file-options.html#option_general_print-defaults">
       <code class="option">
        --print-defaults
       </code>
      </a>
     </p>
     <div class="informaltable">
      <table frame="box" rules="all" summary="Properties for print-defaults">
       <colgroup>
        <col style="width: 30%"/>
        <col style="width: 70%"/>
       </colgroup>
       <tbody>
        <tr>
         <th>
          Command-Line Format
         </th>
         <td>
          <code class="literal">
           --print-defaults
          </code>
         </td>
        </tr>
        <tr>
         <th>
          Type
         </th>
         <td>
          Boolean
         </td>
        </tr>
        <tr>
         <th>
          Default Value
         </th>
         <td>
          <code class="literal">
           false
          </code>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <a class="indexterm" name="idm46045323722144">
     </a>
     <p>
      Print the program name and all options that it gets from
            option files. Password values are masked.
     </p>
     <p>
      See the introduction to this section regarding constraints
            on the position in which this option may be specified.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
