psql: command not found Mac

后端 未结 11 798
清酒与你
清酒与你 2021-01-29 22:16

I installed PostgreSQL via the graphical install on http://www.postgresql.org/download/macosx/

I see it in my applications and also have the psql terminal in my applicat

相关标签:
11条回答
  • 2021-01-29 22:35

    Modify your PATH in .bashrc, not in .bash_profile:

    http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files

    0 讨论(0)
  • 2021-01-29 22:35

    ANSWERED ON OCTOBER 2017

    run

    export PATH=/Library/PostgreSQL/9.5/bin:$PATH
    

    and then restart your terminal.

    0 讨论(0)
  • 2021-01-29 22:39

    For me this worked:

    1. Downloading the App: https://postgresapp.com/downloads.html

    2. Running commands to configure $PATH - note though that it didn't work for me. https://postgresapp.com/documentation/cli-tools.html

    3. Manually add it to the .bash_profile document:

      cd  # to get to your home folder
      open .bash_profile  # to open your bash_profile
      

      In your bash profile add:

      # Postgres
      export PATH=/Applications/Postgres.app/Contents/Versions/latest/bin
      

      Save the file. Restart the terminal. Type 'psql'. Done.

    0 讨论(0)
  • 2021-01-29 22:40

    From the Postgres documentation page:

    sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp

    restart your terminal and you will have it in your path.

    0 讨论(0)
  • If someone used homebrew with Mojave or later:

    export PATH=/usr/local/opt/postgresql@9.5/bin:$PATH
    

    change version if you need!

    0 讨论(0)
提交回复
热议问题