之前裝了一個(gè)postgreSQL數(shù)據(jù)庫(kù),當(dāng)時(shí)裝的時(shí)候數(shù)據(jù)庫(kù)裝到了C盤(pán),現(xiàn)在C盤(pán)的空間不夠存放數(shù)據(jù),需要將數(shù)據(jù)庫(kù)文件夾進(jìn)行移植,具體操作如下:
1、關(guān)閉postgreSQL數(shù)據(jù)庫(kù)服務(wù)。
2、首先到E盤(pán)新建一個(gè)文件夾postgresql_data用來(lái)存放新的數(shù)據(jù)文件。
3、進(jìn)入到C:\Program Files\PostgreSQL\8.4\data 這個(gè)文件夾下邊,將文件夾下邊的所有文件夾及pg_hba.conf,pg_ident.conf,PG_VERSION這三個(gè)文件都剪切到E盤(pán)的postgresql_data文件夾下。
C:\Program Files\PostgreSQL\8.4\data文件下只留
PG_VERSION
postgresql.conf
這五個(gè)文件。
4、修改postgresql.conf文件中的屬性將data_directory屬性改為E:\\postgresql_data 即是新的文件夾的路徑。
5、點(diǎn)擊E:\\postgresql_data這個(gè)文件夾屬性-》安全 添加postgres用戶的訪問(wèn)權(quán)限。
6、點(diǎn)擊開(kāi)始菜單中的 “Reload Configuration” 程序命令
7、啟動(dòng)postgreSQL數(shù)據(jù)庫(kù)服務(wù)。
1、關(guān)閉postgreSQL數(shù)據(jù)庫(kù)服務(wù)。
2、首先到E盤(pán)新建一個(gè)文件夾postgresql_data用來(lái)存放新的數(shù)據(jù)文件。
3、進(jìn)入到C:\Program Files\PostgreSQL\8.4\data 這個(gè)文件夾下邊,將文件夾下邊的所有文件夾及pg_hba.conf,pg_ident.conf,PG_VERSION這三個(gè)文件都剪切到E盤(pán)的postgresql_data文件夾下。
C:\Program Files\PostgreSQL\8.4\data文件下只留
PG_VERSION
postgresql.conf
這五個(gè)文件。
4、修改postgresql.conf文件中的屬性將data_directory屬性改為E:\\postgresql_data 即是新的文件夾的路徑。
5、點(diǎn)擊E:\\postgresql_data這個(gè)文件夾屬性-》安全 添加postgres用戶的訪問(wèn)權(quán)限。
6、點(diǎn)擊開(kāi)始菜單中的 “Reload Configuration” 程序命令
7、啟動(dòng)postgreSQL數(shù)據(jù)庫(kù)服務(wù)。