2016-11-10 35 views
0

我們已經安裝了新鮮的gdb數據庫。但是,當試圖連接template0數據庫時。psql:數據庫「template0」目前不接受連接

[[email protected]~]$ psql -d template0 
psql: FATAL: database "template0" is not currently accepting connections 
[[email protected]~]$ 

我們試圖更新FLAG

​​

但是,它不允許以更新FLAG

+1

你爲什麼認爲你需要連接到'template0'?該數據庫由於某種原因而不允許連接。 –

+0

明白了。我將使用而不是template1 – NEO

回答

2

沒有理由連接到template0中。不應使用template1,因爲這是新建數據庫的默認模板。如果您在template1中創建了一些內容,它將被複制到任何新的數據庫中。如果您使用template1連接到數據庫,然後忘記切換數據庫,那麼很容易忘記。

您可以使用postgres數據庫進行連接。那個沒有用過。

+1

如果我需要爲連接創建新的用戶數據庫。我可以使用postgres數據庫嗎? – NEO

+0

是的,你可以使用* postgres *數據庫。 –

+0

關於忘記切換,以防萬一:https://wiki.postgresql.org/wiki/Adventures_in_PostgreSQL,_Episode_1 – Paolo