国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > PostgreSQL > 正文

在windows下手動初始化PostgreSQL數據庫教程

2020-03-12 23:54:30
字體:
來源:轉載
供稿:網友

在windows下手動初始化PG,是一件比較麻煩的事,下面我具體寫一下過程,大家做一下參考。

環境:win7 64 sp1

PG:9.3.5

1、創建用戶postgres,密碼同樣是postgres:

 

 
  1. net user postgres postgres /add 

2、在數據庫根目錄下建立data目錄:

  1. C:/Program Files/PostgreSQL/9.3>md data 


3、去掉administrator對data目錄的權限:

 

 
  1. C:/Program Files/PostgreSQL/9.3>cacls data /e /t /r administrator 

處理的目錄: C:/Program Files/PostgreSQL/9.3/data

4、將data目錄的權限賦給postgres用戶:

 

 
  1. C:/Program Files/PostgreSQL/9.3>cacls data /e /t /g postgres:C 

處理的目錄: C:/Program Files/PostgreSQL/9.3/data

5、用postgres用戶打開cmd

 

 
  1. C:/Program Files/PostgreSQL/9.3>runas /user:postgres cmd.exe 

輸入 postgres 的密碼:

試圖將 cmd.exe 作為用戶 "SURE-PC/postgres" 啟動...

6、進行初始化,初始化用戶為postgres,字符集為utf8,locale為C:

 

 
  1. C:/Program Files/PostgreSQL/9.3/bin>initdb.exe -D ../data -E utf8 --locale C -U 
  2. postgres 
  3. The files belonging to this database system will be owned by user "postgres"
  4. This user must also own the server process. 
  5.  
  6. The database cluster will be initialized with locale "C"
  7. The default text search configuration will be set to "english"
  8.  
  9. Data page checksums are disabled. 
  10.  
  11. fixing permissions on existing directory ../data ... ok 
  12. creating subdirectories ... ok 
  13. selecting default max_connections ... 100 
  14. selecting default shared_buffers ... 128MB 
  15. creating configuration files ... ok 
  16. creating template1 database in ../data/base/1 ... ok 
  17. initializing pg_authid ... ok 
  18. initializing dependencies ... ok 
  19. creating system views ... ok 
  20. loading system objects' descriptions ... ok 
  21. creating collations ... not supported on this platform 
  22. creating conversions ... ok 
  23. creating dictionaries ... ok 
  24. setting privileges on built-in objects ... ok 
  25. creating information schema ... ok 
  26. loading PL/pgSQL server-side language ... ok 
  27. vacuuming database template1 ... ok 
  28. copying template1 to template0 ... ok 
  29. copying template1 to postgres ... ok 
  30. syncing data to disk ... ok 
  31.  
  32. WARNING: enabling "trust" authentication for local connections 
  33. You can change this by editing pg_hba.conf or using the option -A, or 
  34. --auth-local and --auth-host, the next time you run initdb. 
  35.  
  36. Success. You can now start the database server using: 
  37.  
  38. "postgres" -D "../data" 
  39. or 
  40. "pg_ctl" -D "../data" -l logfile start 
  41.  
  42.  
  43. C:/Program Files/PostgreSQL/9.3/bin> 

7、啟動數據庫,進入客戶端:

 

  1. C:/Program Files/PostgreSQL/9.3/bin>"pg_ctl" -D "../data" start 
  2. server starting 
  3.  
  4. C:/Program Files/PostgreSQL/9.3/bin>LOG: database system was shut down at 2014- 
  5. 09-18 10:19:54 HKT 
  6. LOG: autovacuum launcher started 
  7.  
  8. C:/Program Files/PostgreSQL/9.3/bin>LOG: database system is ready to accept con 
  9. nections 
  10.  
  11. C:/Program Files/PostgreSQL/9.3/bin>psql.exe 
  12. psql (9.3.5) 
  13. Type "help" for help. 
  14.  
  15. postgres=# 

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 中卫市| 女性| 项城市| 静海县| 深水埗区| 兴业县| 伊金霍洛旗| 合肥市| 沂水县| 成武县| 青浦区| 大安市| 万荣县| 时尚| 嘉峪关市| 白玉县| 盐池县| 永济市| 白山市| 迁安市| 会泽县| 墨脱县| 清水河县| 监利县| 遂川县| 叙永县| 松滋市| 朝阳区| 曲水县| 张家口市| 东平县| 瑞安市| 扎囊县| 平泉县| 五家渠市| 博湖县| 永仁县| 泾阳县| 龙川县| 鄂托克前旗| 嘉鱼县|