'mysql' 不是内部或外部命令,也不是可运行的程序,或批处理文件。

来源:互联网 发布:电脑写字板软件下载 编辑:程序博客网 时间:2024/05/16 19:18
在Windows XP中打开DOS,通过输入命令“mysql -u root -p”切换到mysql下,切换失败,如下所示:
Microsoft Windows  [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.
C:>mysql -u root -p
'mysql' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
 
出现这种错误的原因是没有在环境变量PATH中将mysql的路径添加进去。在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>
成功!
0 0
原创粉丝点击