天天看點

【MySQL】MySQL資料導出(未完待續)

背景:

工作場景中,有很多MySQL資料需要導出或同步的場景,這裡對MySQL資料導出的相關資訊進行簡單的梳理

目錄

  1. SQL執行結果導出
  2. 資料表全表導出
  3. 資料庫全表導出

一、SQL查詢結果導出

使用MySQL用戶端導

mysql -h10.10.30.126 -uuser -ptest -P3314 WSC -Ne “select now();” > /root/yangcong.txt

cat sql.sql | mysql -h hostip -P port -u usernmae -p passwd dbname > /tmp/data