Linux 下使用Postgre中的命令,要使用postgres這個使用者
問題:
使用root使用者連線linux執行psql命令(比如 psql -l 命令)
報錯: rote "root" dose not exist
解決方案:
切換到psql下的使用者 命令是:su postgres
使用者切換之後,便可以執行下面的命令了
psql -l 檢視使用者資訊
例項:
這次需要執行的是,匯出部分資料
psql saison -c 'select user_id, user_name from user order by 1,2' user_list.txt -A -F, -t
總結
雖然root是liunx中的超級使用者,但是對於postgre tomcat 等一些程式
它們有自己的使用者,這時,我們就需要切換到該程式相對應的使用者下
su postgres (su switch user)
相關推薦
試試Linux下的ip命令,ifconfig已經過時了
linux的ip命令和ifconfig類似,但前者功能更強大,並旨在取代後者。使用ip命令,只需一個命令,你就能很輕鬆地執行一些網路管理任務。ifconfig是net-tools中已被廢棄使用的一個命令,許多年前就已經沒有維護了。iproute2套件裡提供了許多增強功能的命令,ip命令即是其中之一。
Linux 下使用Postgre中的命令,要使用postgres這個使用者
問題: 使用root使用者連線linux執行psql命令(比如 psql -l 命令) 報錯: rote "root" dose not exist 解決方案: 切換到psql下的使用者 命令是:su postgres 使用者切換之後,便可以執行下面的命令了 psq
Mac下如何用SSH連接遠程Linux服務器及Linux一些常用操作命令,更新中.....
oot .... 地址 密碼 res ini 更新 目錄 讀寫 1、 終端命令 a).打開Mac的命令終端 b).輸入ssh -p 22 [email protected] 它會提示你輸入密碼,輸入正確的密碼之後,你就發現已經登陸成功了.(22: 端口號 roo
linux 下vim中關於刪除某段,某行,或者全部刪除的命令 ZZ
1,先開啟某個檔案: vim filename 2,轉到檔案結尾 在命令模式輸入 G 3,轉到10行 在命令模式輸入 10G 4,刪除所有內容:先用G 轉到檔案尾,然後使用下面命令: :1, .d 5,刪除第10行到第20行的內容:先用20G轉到第20行,然後使用下面命令:
linux下用scp命令在兩個服務器之間傳輸文件,利用php_scp函數進行文件傳輸
evc 在操作 path send 返回值 遠程 false cal 上傳 在linux下利用scp進行文件傳輸, 從服務器下載文件 scp [email protected]/* */:/path/filename /path/filename 上傳
高性能網絡服務器編程:為什麽linux下epoll是最好,Netty要比NIO.2好?
系統 工作效率 lee socket 為我 handler 10g 函數 適合 基本的IO編程過程(包括網絡IO和文件IO)是,打開文件描述符(windows是handler,java是stream或channel),多路捕獲(Multiplexe,即select和poll
linux 下shell中if的“-e,-d,-f”的用法
符號鏈接 符號 字符串變量 -s 長度 目錄 != filename bsp 文件表達式-e filename 如果 filename存在,則為真-d filename 如果 filename為目錄,則為真 -f filename 如果 filename為常規文件,則為真-
Linux下解包/打包,壓縮/解壓命令
res file bzip2 lena dirname unzip bz2 裏的 dir .tar 解包:tar xvf FileName.tar 打包:tar cvf fileName.tar DirName tar.gz和.tgz 解壓:tar zxvf FileNam
Linux下安裝配置 http ,修改本機中http伺服器主頁,自定義顯示內容。
HTTP(Hyper Text Transfer Protocol) 超文字傳輸協議,位於osi模型中的應用層。 安裝:可以使用yum等多種方式安裝,最方便的自然是yum安裝(Redhat需
linux下centos中nginx配置一臺伺服器多個tomcat,多個域名
1.直接貼程式碼自己看 下面是nginx 的nginx.conf檔案配置 一臺伺服器 三個tomcat 埠分別為:8080,7070,7072 三個域名:maijiaxiu.com;console.maijiaxiu.com; test.maijiaxiu.com #user n
Linux下修改rm命令為mv,使rm命令原有功能失效
Linux下修改rm命令,防止誤刪 2017年03月03日 14:34:33 執念丶丶 閱讀數:1570 版權宣告:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/Ace_Shiyuan/article/detai
使用dd命令在Linux下建立大檔案,批量大小檔案生成方法
前沿:最近在開發自動從U盤拷貝大批量檔案到linux系統的的功能。由於需要幾十個G的大檔案來做測試,如果自己去找這麼多資源,然後再拷貝,非常麻煩。所以學了下dd命令,現在總結一下: 一、引數介紹 if=FILE 從FILE中讀取資料,而不是預設的標準輸入。
java類中執行指令碼或命令(比如Linux下的指令碼命令等)
可以使用java中的ProcessBuilder執行本地命令或指令碼等工作: 以下是一個簡單的使用java呼叫本地python指令碼的例子。從某工程程式碼中整理出來的,未封裝,僅供參考。 JAVA 程式碼: List<String> commands=
高效能網路伺服器程式設計:為什麼linux下epoll是最好,Netty要比NIO.2好?
基本的IO程式設計過程(包括網路IO和檔案IO)是,開啟檔案描述符(windows是handler,java是stream或channel),多路捕獲(Multiplexe,即select和poll和epoll)IO可讀寫的狀態,而後可以讀寫的檔案描述符進行IO讀寫,由於IO裝置速度和CPU記憶體比速度會
linux 下shell中if的“-e,-d,-f”是什麼意思
檔案表示式 -e filename 如果 filename存在,則為真 -d filename 如果 filename為目錄,則為真 -f filename 如果 filename為常規檔案,則為真 -L filename 如果 filename為符號連結,則為真 -r
在linux下用echo命令來清理日誌,清理完畢之後不需要重啟
echo "" > /usr/local/tomcat/tms2api.wuliusys.com/logs/catalina.out 這裡是清理在linux下catalina.out tomcat的日誌, 這裡 就是用echo "" > 後面跟目標路徑 將其
Linux下的基本命令(意思理解,便於記憶)
以下為本人對一些記憶Linux基本命令與其作用的小技巧。 我們都知道Linux下的命令不少,有一些命令就知道它那樣但是卻不知道這些命令為何就用那幾個字母組成。下面就對這些命令做一個命令原來
Linux下遠端連線windows,執行命令
演示: 在Linux上遠端登入winodws,執行java程式。 實驗環境: 主機:win7x64 + WMare9.0 兩臺在WMare9.0上的虛擬機器。 虛擬機器A:初始安裝的win7x64 虛擬機器B:ubuntu-13.04-desktop-amd64 注
Linux下QT中執行shell命令
http://my.oschina.net/floristgao/blog/303768 當需要在QT中執行shell命令時可以利用以下方法: (1)首先包含標頭檔案: #include <QProcess> (2)執行shell命令: QProc
指令碼中或者linux下使用iconv命令將utf_8和gbk以及gb2312的相互轉換
1.轉換gbk編碼檔案為utf-8編碼檔案 iconv -f gbk -t utf-8 aa.txt > aa.bak 其中-f指的是原始檔案編碼,-t是輸出編碼 aa.txtl是原始檔案 aa.bak是輸出結果檔案 iconv -c --v