2016-02-26 106 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';