Mysql PostgreSQL-如何使用?

Mysql PostgreSQL-如何使用?,mysql,database,macos,postgresql,terminal,Mysql,Database,Macos,Postgresql,Terminal,我已经在我的MacOSX(10.6)上安装了PostgreSQL。在应用程序中创建了文件夹PostgreSQL 9.1,其中有SQL Shell(psql).app。打开此应用程序后,将打开终端窗口,其中位于命令行服务器[localhost]:上 我有点困惑,我如何才能工作/登录到这个数据库系统?我习惯使用MySQL,我只需在终端窗口键入MySQL-u username-p password,一切都准备好了,但这里我有点困惑。。。如何登录PostgreSQL数据库> 编辑 locate psql

我已经在我的MacOSX(10.6)上安装了PostgreSQL。在应用程序中创建了文件夹PostgreSQL 9.1,其中有SQL Shell(psql).app。打开此应用程序后,将打开终端窗口,其中位于命令行服务器[localhost]:上

我有点困惑,我如何才能工作/登录到这个数据库系统?我习惯使用MySQL,我只需在终端窗口键入MySQL-u username-p password,一切都准备好了,但这里我有点困惑。。。如何登录PostgreSQL数据库>

编辑

locate psql | grep /bin

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.

您可以使用psql登录。如果unix帐户名与db帐户名匹配,并且服务器位于本地主机上,则不需要密码。至少这是postgreSQL中的默认设置(检查pg_hba.conf中的ident)


如果要使用其他db用户,请选中“psql--help”。

当我键入
psql
时,我将得到
-bash:psql:command not found
。当我试图
运行locate psql | grep/bin
时,我得到了一个错误,我将其发布到了原始的post(更长的语句)。如何解决这个问题?请尝试以下方法查找二进制文件:find/-name psql