postsql密码修改
生活随笔
收集整理的這篇文章主要介紹了
postsql密码修改
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1. 修改PostgreSQL數(shù)據(jù)庫默認用戶postgres的密碼
PostgreSQL數(shù)據(jù)庫創(chuàng)建一個postgres用戶作為數(shù)據(jù)庫的管理員,密碼隨機,所以需要修改密碼,方式如下:
步驟一:登錄PostgreSQL
1
sudo -u postgres psql
步驟二:修改登錄PostgreSQL密碼
1
ALTER USER postgres WITH PASSWORD 'postgres';
注:
密碼postgres要用引號引起來
命令最后有分號
步驟三:退出PostgreSQL客戶端
\q
回到頂部
2. 修改linux系統(tǒng)postgres用戶的密碼
PostgreSQL會創(chuàng)建一個默認的linux用戶postgres,修改該用戶密碼的方法如下:
步驟一:刪除用戶postgres的密碼
1
sudo ?passwd -d postgres
步驟二:設置用戶postgres的密碼
1
sudo -u postgres passwd
系統(tǒng)提示輸入新的密碼
1
2
3
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
PostgreSQL數(shù)據(jù)庫創(chuàng)建一個postgres用戶作為數(shù)據(jù)庫的管理員,密碼隨機,所以需要修改密碼,方式如下:
步驟一:登錄PostgreSQL
1
sudo -u postgres psql
步驟二:修改登錄PostgreSQL密碼
1
ALTER USER postgres WITH PASSWORD 'postgres';
注:
密碼postgres要用引號引起來
命令最后有分號
步驟三:退出PostgreSQL客戶端
\q
回到頂部
2. 修改linux系統(tǒng)postgres用戶的密碼
PostgreSQL會創(chuàng)建一個默認的linux用戶postgres,修改該用戶密碼的方法如下:
步驟一:刪除用戶postgres的密碼
1
sudo ?passwd -d postgres
步驟二:設置用戶postgres的密碼
1
sudo -u postgres passwd
系統(tǒng)提示輸入新的密碼
1
2
3
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
總結
以上是生活随笔為你收集整理的postsql密码修改的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Taro+react开发(67):数组中
- 下一篇: [react-router] React