本篇文章給大家分享的是有關(guān)postgresql修改端口后使用psql連接數(shù)據(jù)庫出現(xiàn)報(bào)錯(cuò)如何解決,小編覺得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
今天修改pg的端口號(hào)port改成5435后重啟完數(shù)據(jù)庫的時(shí)候直接psql進(jìn)庫的時(shí)候進(jìn)不去
[postgres@node2 data]$ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432
這時(shí),進(jìn)數(shù)據(jù)庫有兩種方式
1、psql 后面加上端口號(hào)
[postgres@node2 data]$ psql -p 5435 psql (9.6.1) Type "help" for help. postgres=#
2、在環(huán)境變量/home/postgres/.bash_profile中加上一句
export PGPORT=5435
然后
[postgres@node2 ~]$ source ~/.bash_profile [postgres@node2 ~]$ psql psql (9.6.1) Type "help" for help. postgres=#
這樣就可以直接進(jìn)庫了
補(bǔ)充:psql不是默認(rèn)端口時(shí)如何連接postgresql
psql不是默認(rèn)端口時(shí)如何連接postgresql
[stork@instance-609xznso pgsql]$ /usr/pgsql-11/bin/psql c3_data -p 5432 could not change directory to “/var/lib/pgsql”: Permission denied Password for user stork: psql (11.5) Type “help” for help. c3_data=>
自己指定端口就可以了
/usr/pgsql-11/bin/psql xxdatabase -p 端口號(hào)
以上就是postgresql修改端口后使用psql連接數(shù)據(jù)庫出現(xiàn)報(bào)錯(cuò)如何解決,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見到或用到的。希望你能通過這篇文章學(xué)到更多知識(shí)。更多詳情敬請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
文章標(biāo)題:postgresql修改端口后使用psql連接數(shù)據(jù)庫出現(xiàn)報(bào)錯(cuò)如何解決-創(chuàng)新互聯(lián)
本文網(wǎng)址:http://vcdvsql.cn/article6/cedoig.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機(jī)網(wǎng)站建設(shè)、用戶體驗(yàn)、網(wǎng)站內(nèi)鏈、面包屑導(dǎo)航、品牌網(wǎng)站設(shè)計(jì)、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)