天天看點

Mac上使用homebrew安裝PostgreSql安裝解除安裝

brew 安裝 postgresql :

檢視安裝的版本:

安裝成功之後,安裝路徑為:/usr/local/var/postgres

接下來,初始化資料庫:

配置開機登陸(可選):

手動啟動 postgresql

檢視狀态:

停止:

檢視程序:

建立使用者和資料庫:

進入指令行模式:

如果出現 <code>fatal: ident authentication failed for user</code>,是因為:

this is because by default postgresql uses ‘ident’ authentication i.e it checks if the username exists on the system. you need to change authentication mode to ‘trust’ as we do not want to add a system user. modify the settings in “pg_hba.conf” to use ‘trust’ authentication.

請修改 /usr/local/var/postgres/pg_hba.conf 為:

如果配置了開機登陸:

繼續閱讀