can't access mysql from command line mac

前端 未结 7 1230
情话喂你
情话喂你 2020-11-30 21:20

mysql on os x 10.6 is located in /usr/local/mysql/bin/mysql

I get command not found when I type mysql --version in the terminal. Is this be

7条回答
  •  再見小時候
    2020-11-30 21:41

    I've tried all the solutions from the answers but couldn't get mysql command to work from the terminal, always getting the message

    bash: command not found
    

    The solution is to change the .bash_profile, and add the mysql path to .bash_profile

    To do so follow these steps: 1. Open a new Terminal window or make sure you are in the home directory 2. Open .bash_profile using

    nano .bash_profile
    

    3. Add the following command to add the mysql path

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

    4. Press Ctrl+X, then press y and press enter.

    The following is how my .bash_profile looks like

提交回复
热议问题