匯入匯出 備份恢復

2021-08-17 03:28:46 字數 380 閱讀 4190

匯入:

load data infile 『檔案路徑和檔名』 into table 表名字;

匯出:

select 列1,列2 into outfile 『檔案路徑和檔名』 from 表名字;

備份與匯出的區別:匯出的檔案只是儲存資料庫中的資料;而備份,則是把資料庫的結構,包括資料、約束、索引、檢視等全部另存為乙個檔案

備份:

mysqldump -u root 資料庫名》備份檔案名; #備份整個資料庫

mysqldump -u root 資料庫名 表名字》備份檔案名; #備份整個表

恢復:

方法一:source 備份檔案名;

方法二:mysql -u root 資料庫名 《備份檔案名

資料匯入匯出 備份恢復

1 作用 把檔案系統的內容匯入到資料庫中 2 語法 load data infile var lib mysql files 檔名 into table 表名 fields terminated by 分隔符 lines terminated by n 3 將scoretable.csv檔案匯入到資...

mongodb資料匯入匯出以及備份恢復

資料匯出 mongoexport 假設庫里有一張user 表,裡面有2 條記錄,我們要將它匯出 use my mongodb switched to db my mongodb db.user.find 1 常用匯出方法 root localhost bin mongoexport d my mon...

Oracle的匯入匯出 備份與恢復

在oracle中的bin目錄下 exp 使用者名稱 密碼 資料庫名 tables 表明 file d sdfsdf.dmp 匯入 imp 使用者名稱 密碼 資料庫名 file d sdfsdf.dmp 實驗成功 匯入表 imp file c 12.dmp full y ignore y 注意,如果匯...