mac使用mysql命令失败解决办法

摘要: mac上装上mysql后,在终端里输入mysql -uroot -ppassword后回车,总是提示-bash: mysqladmin: command not found 在网上搜了一番,找到解决办法了,自己收藏一下

简单来说就是为mysql这个指令绑定一个可执行程序的路,如mac上默认的mysql路径为/usr/local/mysql/bin

tcsh下:

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

alias mysqladmin /usr/local/mysql/bin/mysqladmin

bash下:

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

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

那么接着就可以在终端上使用指令了,如设置密码

mysqladmin -u root -p password

Last modification:October 1st, 2017 at 09:24 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment