簡體   English   中英

在.bash_profile中,已經設置了路徑,但仍然得到'-bash:mysql:命令未找到'

[英]In .bash_profile already set the path but still got '-bash: mysql: command not found'

我很沮喪,我從OSX的終端中收到嘗試使用ipythonmysql的錯誤消息。 它曾經可以正常工作,但是現在我收到了錯誤消息。 即使導航到mysql的安裝位置,我仍然會收到錯誤消息:

Bruces-MacBook-Pro:bin bruce$ pwd
/usr/local/mysql/bin
Bruces-MacBook-Pro:bin bruce$ ls
innochecksum            mysqlbinlog
lz4_decompress          mysqlcheck
my_print_defaults       mysqld
myisam_ftdump           mysqld-debug
myisamchk           mysqld_multi
myisamlog           mysqld_safe
myisampack          mysqldump
mysql               mysqldumpslow
mysql_client_test_embedded  mysqlimport
mysql_config            mysqlpump
mysql_config_editor     mysqlshow
mysql_embedded          mysqlslap
mysql_install_db        mysqltest_embedded
mysql_plugin            mysqlxtest
mysql_secure_installation   perror
mysql_ssl_rsa_setup     replace
mysql_tzinfo_to_sql     resolve_stack_dump
mysql_upgrade           resolveip
mysqladmin          zlib_decompress
Bruces-MacBook-Pro:bin bruce$ mysql
-bash: mysql: command not found

我進行了一些搜索,發現應該將路徑添加到.bash_profile$PATH變量中,現在我只需使用less .bash_profile來檢查該路徑是否在我的路徑上,以下是我得到的結果:

export PATH="/usr/local/mysql/bin:$PATH"

export PATH="/Users/bruce/anaconda2/bin:$PATH"

export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH"

export PATH="/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:$PATH"

export PATH="/Library/Python/2.7/site-packages"

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"

export PATH="/Users/bruce/anaconda/bin:$PATH"

export PATH="/usr/local/bin:$PATH"

export PATH="/usr/bin:$PATH"

export PATH="/bin:$PATH"

export PATH="/usr/sbin:$PATH"

export PATH="/sbin:$PATH"

export PATH="/opt/X11/bin:$PATH"

.bash_profile (END)

(注意:主文件夾下有幾個.bash_profilexxxx文件。我需要修改其中的一些嗎?

.bash_profile
.bash_profile-anaconda.bak
.bash_profile-anaconda2.bak
.bash_profile.macports-saved_2015-12-29_at_23:07:52
.bash_profile.pysave

似乎我無法直接在主文件夾下找到.bash_profile.pysave ,但是只能使用ls -a命令? 如果需要修改此文件,該怎么辦?

我剛剛發現了為什么會這樣。 我的筆記本電腦中有兩個磁盤。 並且許多文件都備份在具有相同名稱的舊磁盤中。 因此,我編輯的.bash_profile實際上位於較舊的磁盤上,而不位於主文件夾下。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM