009.PGSQL-pgsql在windows下的安裝啟動


安裝
https://www.yoytang.com/postgres-windows-install-and-config.html

下載最新的zip包 http://get.enterprisedb.com/postgresql/postgresql-9.5.2-1-windows-x64-binaries.zip

配置環境變量

 

 

 

initdb -D  E:\postgresql\pgsql12\data  -U postgres

postgres -D E:\postgresql\pgsql12\data

登陸
E:\postgresql\pgsql\bin>psql -h localhost -U postgres -d postgres -p 5432
-h:數據庫IP
-U:登錄用戶
-d:登錄的數據庫
-p:登錄端口

修改密碼
alter user postgres with password '123456';

查看數據庫

\l

 

 

 

進入對應的庫

 

 

 

退出數據庫
\q

 

 

重啟服務
pg_ctl -D "E:\postgresql\pgsql\data" -l logfile restart

pg_ctl -D "E:\postgresql\pgsql\data" -l logfile start

查看狀態
pg_ctl -D "E:\postgresql\pgsql\data" -l logfile status


關閉服務
pg_ctl -D "E:\postgresql\pgsql\data" -l logfile stop

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM