[英]Windows PATH seems broken in Git Bash
I installed MySQL and wanted to see if it worked well, testing it on Git Bash (the course told me to do so).我安装了 MySQL 并想看看它是否运行良好,在 Git Bash 上测试它(课程告诉我这样做)。 The code I had to write was the following one: export PATH=/c/Program Files/MySQL/MySQL Server 8.0/bin/:$PATH
.我必须编写的代码如下: export PATH=/c/Program Files/MySQL/MySQL Server 8.0/bin/:$PATH
。
The main issue is that every time I open again Git Bash there are several lines saying not a valid identifier .主要问题是,每次我再次打开 Git Bash 时,都会有几行说not a valid identifier 。 I can't provide an image as I'm new, but one of the examples might be:由于我是新手,我无法提供图像,但其中一个示例可能是:
bash: export: `Corporation/NVIDIA': not a valid identifier bash: 导出: `Corporation/NVIDIA': 不是一个有效的标识符
Although I deleted Git Bash and reinstalled again, the problem persists.虽然我删除了Git Bash并重新安装,但问题仍然存在。 Does anyone know how to fix that on Windows?有谁知道如何在 Windows 上解决这个问题?
Thanks in advance!提前致谢!
Because the path contains spaces, it needs to be quoted:因为路径包含空格,所以需要加引号:
export PATH="/c/Program Files/MySQL/MySQL Server 8.0/bin/:$PATH"
You need to change this in whatever file you originally wrote this line in;您需要在最初编写此行的任何文件中更改它; it's probably named .bashrc
or .bash_profile
and can be found in your home directory (typically c:\\Users\\YourUsername
).它可能命名为.bashrc
或.bash_profile
并且可以在您的主目录中找到(通常是c:\\Users\\YourUsername
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.