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
mysql is not recognised as an internal or external command,operable program or batch
提问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
回答by Emmanuel Osimosu
MYSQL_HOME:
MYSQL_HOME:
C:\Program Files\MySQL\MySQL Server 5.0
Path:
小路:
%MYSQL_HOME%\bin;
回答by Abu Bakr
Here 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
回答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 的东西都不熟悉,所以如果这听起来很简单,请原谅。