2016-02-26 100 views
0

我想在postgreSQL.But中設置新密碼,但是我收到如下所示的錯誤。 [[email protected] ~]# sudo -u postgres psql在PostgreSQL中設置密碼

could not change directory to "/root" 
Welcome to psql 8.1.23, the PostgreSQL interactive terminal. 
    Type: \copyright for distribution terms 
    \h for help with SQL commands 
    \? for help with psql commands 
    \g or terminate with semicolon to execute query 
    \q to quit`postgres=# \password postgres 
    Query buffer is empty. 
    \p: extra argument "assword" ignored 
    \p: extra argument "postgres" ignored` 

回答

0

試試這個? Link
登錄您的數據庫,並使用ALTER USER Postgres WITH PASSWORD '<newpassword>';命令。

0

這適用於我。 ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';