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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5920136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 19:48:03  来源:igfitidea点击:

mysql is not recognised as an internal or external command,operable program or batch

mysqlmysql-error-1064

提问by hari

I had set the MySQL path, but still getting the same error. Please let me know whether I followed the correct one or not.

我已经设置了 MySQL 路径,但仍然出现相同的错误。请让我知道我是否遵循了正确的方法。

MySQL location is: C:\Program Files\MySQL\MySQL Server 5.0\bin

MySQL 位置是: C:\Program Files\MySQL\MySQL Server 5.0\bin

In Windows, system variables I had set the path as:

在 Windows 中,我将路径设置为系统变量:

  • variable name: MYSQL_HOME
  • variable value: C:\Program Files\MySQL\MySQL Server 5.0\bin
  • 变量名: MYSQL_HOME
  • 变量值: C:\Program Files\MySQL\MySQL Server 5.0\bin

For PATH setting:

对于 PATH 设置:

  • variable name: PATH
  • variable value: .;%JAVA_HOME%\bin;%MYSQL_HOME%\bin...
  • 变量名: PATH
  • 变量值: .;%JAVA_HOME%\bin;%MYSQL_HOME%\bin...

If it is not the correct one, please let me know the correct path and its settings.

如果它不正确,请告诉我正确的路径及其设置。

采纳答案by David Fells

MYSQL_HOME variable value:C:\Program Files\MySQL\MySQL Server 5.0\bin %MYSQL_HOME%\bin

MYSQL_HOME 变量值:C:\Program Files\MySQL\MySQL Server 5.0\bin %MYSQL_HOME%\bin

See the problem? This resolves to a path of C:\Program Files\MySQL\MySQL Server 5.0\bin\bin

看到问题了吗?这解决了一个路径C:\Program Files\MySQL\MySQL Server 5.0\bin\bin

回答by Pratik

Simply type in command prompt :

只需在命令提示符中输入:

set path=%PATH%;D:\xampp\mysql\bin;

set path=%PATH%;D:\xampp\mysql\bin;

Here my path started from D so I used D: , you can use C: or E:

这里我的路径从 D 开始,所以我使用了 D: ,你可以使用 C: 或 E:

enter image description here

在此处输入图片说明

回答by Emmanuel Osimosu

MYSQL_HOME:

MYSQL_HOME:

C:\Program Files\MySQL\MySQL Server 5.0

Path:

小路:

%MYSQL_HOME%\bin;

回答by Abu Bakr

enter image description hereHere what I DO on MY PC I install all software that i usually used in G: partian not C: if my operating system is fall (win 10) , Do not need to reinstall them again and lost time , Then How windows work it update PATH automatic if you install any new programe or pice of softwore ,

在此处输入图片说明这是我在我的 PC 上所做的,我安装了我通常在 G 中使用的所有软件:partian 而不是 C:如果我的操作系统失败(win 10),不需要再次重新安装它们并浪费时间,那么 Windows 是如何工作的呢?如果您安装任何新程序或软件,路径自动,

SO

所以

I must update PATH like these HERE! all my software i usually used 1- I created folder called Programe Files 2- I install all my programe data in these folder 3-and then going to PATH and add it Dont forget ;

我必须在这里更新 PATH !我通常使用的所有软件 1- 我创建了名为 Programe Files 的文件夹 2- 我将所有程序数据安装在这些文件夹中 3- 然后转到 PATH 并添加它 不要忘记;

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;G:\HashiCorp\Vagrant\bin;G:\xampp\php;G:\xampp\mysql\bin;G:\Program Files (x86)\heroku\bin;G:\Program Files (x86)\Git\bin;G:\Program Files (x86)\composer;G:\Program Files (x86)\nodejs;G:\Program Files (x86)\Sublime Text 3;G:\Program Files (x86)\Microsoft VS Code\bin;G:\Program Files (x86)\cygwin64\bin

enter image description here

在此处输入图片说明

回答by Rajib

I am using xampp. For me best option is to change environment variables. Environment variable changing window is shared by @Abu Bakr in this thread

我正在使用 xampp。对我来说最好的选择是更改环境变量。环境变量更改窗口在此线程中由@Abu Bakr 共享

I change the path value as C:\xampp\mysql\bin; and it is working nice

我将路径值更改为 C:\xampp\mysql\bin; 它运行良好

回答by Sahasra

In my case, it turned out to be a simple case of spacing.

就我而言,结果证明是一个简单的间距案例。

Turns out, i had a space inserted after the last ; and before ""C:\Program Files\MySQL\MySQL Server 5.7" For this very simple reason, no matter what i did, MySql was still not being recognized.

原来,我在最后一个之后插入了一个空格;而在“C:\

Once i eliminated the spaces before and after path, it worked perfectly.

一旦我消除了路径前后的空格,它就完美地工作了。

In retrospect, seems like a very obvious answer, but nobody's mentioned it anywhere.

回想起来,似乎是一个非常明显的答案,但没有人在任何地方提到它。

Also, i'm new to this whole windows thing, so please excuse me if it sounds very simple.

另外,我对整个 Windows 的东西都不熟悉,所以如果这听起来很简单,请原谅。

回答by latifa saee

In my case, I resolved it by adding this C:\xampp\mysql\binpath in system variablesthen restarted cmd.

就我而言,我通过C:\xampp\mysql\binsystem variablesthen restarted 中添加此路径来解决它cmd

Note: Click meif you don't know how to set the path and system variables.

注意:如果您不知道如何设置路径和系统变量,请单击我