如何在Windows XP上启动MySQL服务器 [英] How to start MySQL server on windows xp

查看:250
本文介绍了如何在Windows XP上启动MySQL服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试通过键入启动MySQL

Whenever I try to start MySQL by typing

> mysql -u root

我得到了错误

错误2003(HY000):无法连接到本地主机"(10061)上的MySQL服务器

ERROR 2003(HY000): Can't connect to MySQL server on 'localhost' (10061)

我该如何解决以上问题?我刚刚下载了MySQL并将其解压缩到E:驱动器中.我什么也没做.我必须先建立连接吗?如果是这样,我该怎么办?

How can I solve the problem above? I just downloaded MySQL and unzipped it in the E: drive. I have not done anything else. Do I have to make a connection first? If so, how can I do that?

推荐答案

可以从命令行手动启动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官方页面

这篇关于如何在Windows XP上启动MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆