Mac快速進入mysql命令列

2021-09-27 10:36:55 字數 1213 閱讀 3547

mysql server在mac上安裝好之後,直接在mac終端輸入[mysql]連線是沒有反應的,會報[-bash: mysql: command not found]的錯誤。這是因為,mysql的安裝程式沒有將其新增到系統的環境變數。我們可以通過進入到mysql所在的目錄啟動mysql客戶端。

1.終端輸入進入bin 目錄

cd /usr/local/mysql/bin/
2.mysql登入,輸入密碼即可

./mysql -uroot -p
為了在終端任何地方都能啟動mysql連線,我們用別名的方式解決。

1、編輯.bash_profile檔案

nisjdemacbook-pro:~ nisj$ cat .bash_profile 

alias ll='ls -alf'

alias mysql=/usr/local/mysql/bin/mysql

2、使之生效

nisjdemacbook-pro:~ nisj$ source .bash_profile
3、測試效果

nisjdemacbook-pro:~ nisj$ mysql -uroot -p

enter password: 

welcome to the mysql monitor.  commands end with ; or \g.

your mysql connection id is 14

server version: 8.0.17 mysql community server - gpl

oracle is a registered trademark of oracle corporation and/or its

affiliates. other names may be trademarks of their respective

owners.

type 'help;' or '\h' for help. type '\c' to clear the current input statement.

mysql>

Mac命令列學習

解壓命令相關 android簽名相關 verbose suboptions 簽名 驗證時輸出詳細資訊。子選項可以是 all,grouped 或 summary digestalg 演算法 摘要演算法的名稱 sigalg 演算法 簽名演算法的名稱 keystore 金鑰庫位置 storepass 口令...

Mac 命令列操作

sudo launchctl load w system library launchdaemons ssh.plistsudo launchctl unload w system library launchdaemons ssh.plistsudo launchctl list grep ssh...

學習 mac 命令列

複製貼上的若愚老師的筆記 檢視當前完整路徑 pwd檢視當前目錄下檔案 不包括隱藏檔案 ls e.g.ls readme 意思是顯示以readme開頭的所有檔案,不管是什麼字尾名 檢視當前目錄下所有檔案 包括隱藏檔案 ls a 檢視當前目錄下所有檔案 包括隱藏檔案 的詳細資訊 ls al切換目錄 cd...