The MySQL server can be started manually from the command line. This can be done on any version of Windows.MySQL服务器可以从命令行手动启动。这可以在任何版本的Windows上完成。
To start the mysqld server from the command line, you should start a console window (or “DOS window”) and enter this command:要从命令行启动mysqld服务器,您应该启动一个控制台窗口(或“DOS窗口”)并输入以下命令:
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"
The path to mysqld may vary depending on the install location of MySQL on your system.mysqld的路径可能因MySQL在系统上的安装位置而异。
You can stop the MySQL server by executing this command:您可以通过执行以下命令来停止MySQL服务器:
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" -u root shutdown
If the MySQL 如果MySQLroot
user account has a password, you need to invoke mysqladmin with the -p
option and supply the password when prompted.root
用户帐户有密码,则需要使用-p
选项调用mysqladmin,并在提示时提供密码。
This command invokes the MySQL administrative utility mysqladmin to connect to the server and tell it to shut down. The command connects as the MySQL 这个命令调用MySQL管理实用程序mysqladmin来连接到服务器并告诉它关闭。该命令以MySQL root用户的身份连接,MySQL root
user, which is the default administrative account in the MySQL grant system.root
用户是MySQL授予系统中的默认管理帐户。
Users in the MySQL grant system are wholly independent from any operating system users under Microsoft Windows.MySQL授权系统中的用户完全独立于Microsoft Windows下的任何操作系统用户。
If mysqld doesn't start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem. 如果mysqld没有启动,请检查错误日志,查看服务器是否在其中写入了任何消息来指示问题的原因。By default, the error log is located in the 默认情况下,错误日志位于C:\Program Files\MySQL\MySQL Server 8.0\data
directory. C:\Program Files\MySQL\MySQL Server 8.0\data
目录中。It is the file with a suffix of 它是后缀为.err
, or may be specified by passing in the --log-error
option. .err
的文件,也可以通过传递--log-error
选项来指定。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.--console
选项启动服务器;在这种情况下,服务器可以在屏幕上显示一些有用的信息来帮助解决问题。
The last option is to start mysqld with the 最后一个选项是使用--standalone
and --debug
options. --standalone
和--debug
选项启动mysqld。In this case, mysqld writes a log file 在这种情况下,mysqld会编写一个日志文件C:\mysqld.trace
that should contain the reason why mysqld doesn't start. C:\mysqld.trace
,其中应该包含mysqld没有启动的原因。See Section 5.9.4, “The DBUG Package”.请参阅第5.9.4节,“DBUG软件包”。
Use mysqld --verbose --help to display all the options that mysqld supports.使用mysqld --verbose --help
显示mysqld支持的所有选项。