簡單來說就是爲mysql這個指令綁定一個可執行程序的路,如mac上默認的mysql路徑爲/usr/local/mysql/binmysql
tcsh下:sql
alias mysql /usr/local/mysql/bin/mysqlbash
alias mysqladmin /usr/local/mysql/bin/mysqladminspa
bash下:orm
alias mysql=/usr/local/mysql/bin/mysqlserver
alias mysqladmin=/usr/local/mysql/bin/mysqladminci
那麼接着就能夠在終端上使用指令了,如設置密碼
it
mysqladmin -u root -p passwordfile
sudo /usr/local/mysql/support-files/mysql.server start (stop)終端