无法从命令提示符运行MySQL [英] Can't run MySQL from command prompt

查看:413
本文介绍了无法从命令提示符运行MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Windowsx64下载了MySQL 5.6.25,并尝试运行命令

I downloaded MySQL 5.6.25 for Windowsx64 and I tried to run the command

mysql -uroot -p

开始使用MySQL,但提示

to start using MySQL but it says

'mysql' is not recognized as an internal or external command, operable program or batch file.

我需要将MySQL移到其他地方吗?当前在桌面上.

Do I need to move MySQL to some other place? It is currently on the desktop.

我下载了Xampp,但是现在当我运行相同的命令时,我得到了:

推荐答案

如果您不在mysql的bin目录中,则需要将mysql放入环境变量PATH中,以便从命令提示符运行它.

You need to place mysql in your environment variable PATH in order to run it from the command prompt, if you are not in bin directory of mysql.

在Windows 7上(应该与Windows 7类似):

On windows 7 (should be similar for 8):

  1. 转到> system
  2. 在左侧,您应该会看到>双击
  3. system properties的底部,您应该看到Environment Variables
  4. 在底部面板中向下滚动,直到看到PATH单击它
  5. 然后单击下面的EDIT按钮,打开新窗口Edit system variables
  6. 最后,将路径添加到mysql安装bin文件夹,例如C:\mysql\mysql5.6.23\bin;(必须用;分隔).
  1. go to control panel>system
  2. on left hand side you should see Advanced system settings>double click on that
  3. At bottom of system properties you should see Environment Variables
  4. scroll down in the bottom panel till you see PATH click on it
  5. then click EDIT button underneath>opens new window Edit system variables
  6. at the end add your path to your mysql installation bin folder like C:\mysql\mysql5.6.23\bin; (must separate by ;).

这篇关于无法从命令提示符运行MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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