简体   繁体   English

Windows PATH 在 Git Bash 中似乎已损坏

[英]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.

相关问题 Git Bash(Windows)不使用PATH - Git Bash (Windows) not using PATH git git bash shell(Windows)中的Git diff损坏 - Git diff broken in window git bash shell (Windows) 如何在Windows中使用git bash设置python路径? - How to set python path with git bash in windows? 如何将git添加到PATH(Windows上的Bash) - How to add git to PATH (Bash on Windows) 在Git for windows“git bash”中,如何以Windows路径格式“打印工作目录”,可以使用cmd和Windows资源管理器吗? - In Git for windows “git bash”, how to “print working directory” in Windows path format that is usable by cmd and Windows explorer? git-bash $PATH 无法解析带空格的 windows 目录 - git-bash $PATH cannot parse windows directory with space 从具有正确格式的Windows的“ git bash”中检索存储库的路径 - retrieve the path of a repo from the “git bash” from windows with right format 子上下文菜单的“git bash here”在 Windows 根路径中打开 - “git bash here” of subcontext menu opens in windows root path 将 windows 路径复制到基于 linux 的终端:Conemu、Cygwin、Git Z7024FF0860DEC6AB1779C7A - Copy windows path into linux based terminals: Conemu, Cygwin, Git Bash 在 git bash(终端或脚本)中将 posix 路径转换为 windows? - Convert a posix path to windows in git bash (terminal or script)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM