postgresql學習筆記
阿新 • • 發佈:2019-01-06
同步 sql bin 密碼 客戶端 ron 操作 下載 pgsql
postgresql學習筆記
安裝
官方下載安裝,已同步onedrive
https://www.postgresql.org/
文檔:https://www.postgresql.org/docs/11
初始化:
initdb.exe -D d:\postgresql\data -E UTF-8 --locale=chs -U postgres -W
-D :指定數據庫簇的存儲目錄E:\pgsql\data
-E :指定DB的超級用戶的用戶名postgres
--locale:關於區域設置(chinese-simplified-china)
-U :默認編碼格式chs
-W :為超級用戶指定密碼的提示
啟動服務:pg_ctl start
停止服務:pg_ctl stop
圖形化界面:pgAdmin 4。需要先創建連接
環境變量PATH添加:D:\Software\PostgreSQL\bin
環境變量PGDATA添加:D:\Software\PostgreSQL\data
基本操作
數據庫由客戶端和服務器組成。
創建數據庫:createdb -h localhost -U postgres mydb 默認用戶名postgres
#
postgresql學習筆記