MySQL - $PATH
Mysql-設定環境變數$PATH
方法一:
直接進入系統/etc更新後重新開機,這樣一來,以後一開啟Terminal就可以直接下 mysql 指令了。



方法二:
是說 您得先看你的是什麼shell
我的話是zsh
或是可以像其它網路教學的選擇更改~/.bash_profile
, 但經過測試 .zsh .bashrc .bash_profile 都需開機後再次source該shell ,很麻煩的~ 所以最後我選擇直接系統paths加入mysql bin的路徑就好了。

補充說明:
/etc/profile和/etc/paths是系統級別的,系統啟動就會載入,
關於
若~/.bash_profile存在,其它bash shell檔就不讀了
而~/.bashrc是bash shell開啟的時候載入的。
方法一:
直接進入系統/etc更新後重新開機,這樣一來,以後一開啟Terminal就可以直接下 mysql 指令了。



方法二:
是說 您得先看你的是什麼shell
我的話是zsh
或是可以像其它網路教學的選擇更改~/.bash_profile
, 但經過測試 .zsh .bashrc .bash_profile 都需開機後再次source該shell ,很麻煩的~ 所以最後我選擇直接系統paths加入mysql bin的路徑就好了。

補充說明:
/etc/profile和/etc/paths是系統級別的,系統啟動就會載入,
關於
若~/.bash_profile存在,其它bash shell檔就不讀了
而~/.bashrc是bash shell開啟的時候載入的。
Comments
Post a Comment