Windows 上的 MySql 环境变量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2259718/
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-09-15 13:55:28  来源:igfitidea点击:

MySql environment variable on windows

mysqlwindowsenvironment-variableslocalhost

提问by joepour

I have installed Mysql on my localhost and it works fine with phpMyAdmin. I have set my CLASSPATH to C:\xampp\mysql\bin\ but when I try and run 'mysql' from the command line it doesnt recognise it. If I navigate to C:\xampp\mysql\bin\ in the command line I can run mysql commands fine.

我已经在我的本地主机上安装了 Mysql,它在 phpMyAdmin 上运行良好。我已将 CLASSPATH 设置为 C:\xampp\mysql\bin\,但是当我尝试从命令行运行 'mysql' 时,它无法识别它。如果我在命令行中导航到 C:\xampp\mysql\bin\,我可以正常运行 mysql 命令。

Any ideas?

有任何想法吗?

Thanks,

谢谢,

Joe

回答by Andrew

Add it to PATH variable, not CLASSPATH.

将它添加到 PATH 变量,而不是 CLASSPATH。