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 (or“DOS 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
If the MySQLroot
user account has a password, you need to invokemysqladminwith the-p
option 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 MySQLroot
user, which is the default administrative account in the MySQL grant system.
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\data
directory. It is the file with a suffix of.err
或可能由pa指定ssing in the--log-error
option. Alternatively, you can try to start the server with the--console
option; 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--standalone
and--debug
options. In this case,mysqldwrites a log fileC:\mysqld.trace
that should contain the reason whymysqlddoesn't start. SeeThe DBUG Package.
Usemysqld --verbose --helpto display all the options thatmysqldsupports.