<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="windows-start-command-line">
      </a>
      2.3.3.6 Starting MySQL from the Windows Command Line
     </h4>
    </div>
   </div>
  </div>
  <p>
   The MySQL server can be started manually from the command line.
        This can be done on any version of Windows.
  </p>
  <p>
   To start the
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   server from the command
        line, you should start a console window (or
   <span class="quote">
    “
    <span class="quote">
     DOS
        window
    </span>
    ”
   </span>
   ) and enter this command:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa81298816"><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"><span class="token prompt">C:\&gt;</span> <span class="token atrule">"C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld"</span></code></pre>
  </div>
  <p>
   The path to
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   may vary depending on the
        install location of MySQL on your system.
  </p>
  <p>
   You can stop the MySQL server by executing this command:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa73187633"><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"><span class="token prompt">C:\&gt;</span> <span class="token atrule">"C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqladmin"</span> <span class="token property">-u</span> root shutdown</code></pre>
  </div>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    If the MySQL
    <code class="literal">
     root
    </code>
    user account has a
          password, you need to invoke
    <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
     <span class="command">
      <strong>
       mysqladmin
      </strong>
     </span>
    </a>
    with the
    <code class="option">
     -p
    </code>
    option and supply the password
          when prompted.
   </p>
  </div>
  <p>
   This command invokes the MySQL administrative utility
   <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
    <span class="command">
     <strong>
      mysqladmin
     </strong>
    </span>
   </a>
   to connect to the server and tell
        it to shut down. The command connects as the MySQL
   <code class="literal">
    root
   </code>
   user, which is the default
        administrative account in the MySQL grant system.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Users in the MySQL grant system are wholly independent from
          any operating system users under Microsoft Windows.
   </p>
  </div>
  <p>
   If
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   doesn't start, check the error log
        to see whether the server wrote any messages there to indicate
        the cause of the problem. By default, the error log is located
        in the
   <code class="filename">
    C:\Program Files\MySQL\MySQL Server
        8.4\data
   </code>
   directory. It is the file with
        a suffix of
   <code class="filename">
    .err
   </code>
   , or may be specified by
        passing in the
   <a class="link" href="server-options.html#option_mysqld_log-error">
    <code class="option">
     --log-error
    </code>
   </a>
   option. Alternatively, you can try to start the server with the
   <a class="link" href="server-options.html#option_mysqld_console">
    <code class="option">
     --console
    </code>
   </a>
   option; in this case,
        the server may display some useful information on the screen to
        help solve the problem.
  </p>
  <p>
   The last option is to start
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   with the
   <a class="link" href="server-options.html#option_mysqld_standalone">
    <code class="option">
     --standalone
    </code>
   </a>
   and
   <a class="link" href="server-options.html#option_mysqld_debug">
    <code class="option">
     --debug
    </code>
   </a>
   options. In this case,
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   writes a log file
   <code class="filename">
    C:\mysqld.trace
   </code>
   that should contain the
        reason why
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   doesn't start. See
   <a class="xref" href="dbug-package.html" title="7.9.4 The DBUG Package">
    Section 7.9.4, “The DBUG Package”
   </a>
   .
  </p>
  <p>
   Use
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld --verbose --help
     </strong>
    </span>
   </a>
   to display all
        the options that
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   supports.
  </p>
 </div>
 <br/>
</div>
