10bet网址
MySQL and Windows
Related Documentation Download this Excerpt

1.4.6 Starting MySQL from the Windows Command Line

The MySQL server can be started manually from the command line. This can be done on any version of Windows.

To start themysqldserver from the command line, you should start a console window (orDOS window) and enter this command:

C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"

The path tomysqldmay vary depending on the install location of MySQL on your system.

You can stop the MySQL server by executing this command:

C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" -u root shutdown
Note

If the MySQLrootuser account has a password, you need to invokemysqladminwith the-poption and supply the password when prompted.

This command invokes the MySQL administrative utilitymysqladminto connect to the server and tell it to shut down. The command connects as the MySQLrootuser, which is the default administrative account in the MySQL grant system.

Note

Users in the MySQL grant system are wholly independent from any operating system users under Microsoft Windows.

Ifmysqlddoesn'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 theC:\Program Files\MySQL\MySQL Server 8.0\datadirectory. It is the file with a suffix of.err或可能由pa指定ssing in the--log-erroroption. Alternatively, you can try to start the server with the--consoleoption; in this case, the server may display some useful information on the screen to help solve the problem.

The last option is to startmysqldwith the--standaloneand--debugoptions. In this case,mysqldwrites a log fileC:\mysqld.tracethat should contain the reason whymysqlddoesn't start. SeeThe DBUG Package.

Usemysqld --verbose --helpto display all the options thatmysqldsupports.