且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Windows XP上启动MySQL服务器

更新时间:2023-10-25 08:44:16

可以从命令行手动启动MySQL服务器.这可以在任何版本的Windows上完成.

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

要从命令行启动mysqld服务器,您应该启动一个控制台窗口(或"DOS窗口")并输入以下命令:

To start the mysqld server from the command line, you should start a console window (or "DOS window") and enter this command:

shell> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld"
The path to mysqld may vary depending on the install location of MySQL on your system.

您可以通过执行以下命令来停止MySQL服务器:

You can stop the MySQL server by executing this command:

shell> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root shutdown

**注意:**

如果MySQL root用户帐户具有密码,则需要使用-p选项调用mysqladmin并在出现提示时提供密码.

If the MySQL root user account has a password, you need to invoke mysqladmin with the -p option and supply the password when prompted.

此命令调用MySQL管理实用程序mysqladmin连接到服务器并告诉它关闭.该命令以MySQL根用户身份连接,该用户是MySQL授权系统中的默认管理帐户.请注意,MySQL授予系统中的用户完全独立于Windows下的任何登录用户.

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 root user, which is the default administrative account in the MySQL grant system. Note that users in the MySQL grant system are wholly independent from any login users under Windows.

如果mysqld没有启动,请检查错误日志以查看服务器是否在其中写入了任何消息以指示问题的原因.错误日志位于C:\ Program Files \ MySQL \ MySQL Server 5.0 \ data目录中.该文件的后缀为.err.您也可以尝试以mysqld --console的身份启动服务器;在这种情况下,您可能会在屏幕上获得一些有用的信息,这些信息可能有助于解决问题.

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. The error log is located in the C:\Program Files\MySQL\MySQL Server 5.0\data directory. It is the file with a suffix of .err. You can also try to start the server as mysqld --console; in this case, you may get some useful information on the screen that may help solve the problem.

最后一个选项是使用--standalone和--debug选项启动mysqld.在这种情况下,mysqld会写一个日志文件C:\ mysqld.trace,其中应包含mysqld无法启动的原因.请参阅MySQL内部:移植到其他系统.

The last option is to start mysqld with the --standalone and --debug options. In this case, mysqld writes a log file C:\mysqld.trace that should contain the reason why mysqld doesn't start. See MySQL Internals: Porting to Other Systems.

通过 MySQL官方页面