Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5600369
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类:

2007-12-16 16:00:37

在WindowsXP中打开DOS,通过输入命令“mysql -u root -p”切换到mysql下,切换失败,如下所示:
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\>mysql -u root -p
'mysql' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
 
出现这种错误的原因是没有在环境变量PATH中将mysql的路径添加进去。如果是在unix平台,可以通过PATH=XXX;export PATH来进行路径的添加,在WindowsXP平台下,需要按照下面的方法来将mysql路径添加到环境变量中:

右键点击“我的电脑”-“属性”-“高级”-“环境变量”-“系统变量”-双击“Path”-将mysql的路径“C:\Program Files\MySQL\MySQL Server 5.0\bin”添加进去-“确定”
添加完毕之后,再到DOS下进行测试:
C:\>mysql -u root -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
成功!
阅读(5353) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~