資料庫匯入匯出(2)

2021-08-29 21:14:34 字數 1109 閱讀 4765

mysql資料匯入匯出語句

匯出:select * from ebook into outfile "bookdev.txt" fields enclosed by '"' terminated by "," lines terminated by " "

匯入:load data infile "bookdev.txt" into table ebook fields enclosed by '"' terminated by "," lines terminated by " "

///////////////////////////////////////

mysql sql語句匯入與匯出

匯入: mysql -u root -p 資料庫名 如: c:\mysql\bin>mysql -u root -p house < c:\1-1.txt

匯出: mysqldump -u root -p 資料庫名 [表名1 表名2] > 輸出位址 其中表名可選

如: 匯出house中的blacklist表 c:\mysql\bin>mysqldump -u root house blacklist > c:\1-1.txt

匯出house中的blacklist和userinfo表 c:\mysql\bin>mysqldump -u root house blacklist userinfo> c:\1-1.txt

匯出house中的所有表 c:\mysql\bin>mysqldump -u root house > c:\1-1.txt

在使用mysqldump中可以使用 "-d" ,這時只匯出表結構,沒有資料 如: 匯出house中的所有表 ,這時只有表結構 c:\mysql\bin>mysqldump -u root -d house > c:\1-1.txt 匯出:select * from ebook into outfile "bookdev.txt" fields enclosed by '"' terminated by "," lines terminated by "\n"

匯入:load data infile "bookdev.txt" into table ebook fields enclosed by '"' terminated by "," lines terminated by "\n"

匯入匯出資料庫

1.匯出整個資料庫 mysqldump u 使用者名稱 p 資料庫名 匯出的檔名 2.匯出乙個表 mysqldump u 使用者名稱 p 資料庫名 表名 匯出的檔名 3.匯入資料庫 mysql 資料庫名 檔案 mysql u root 資料庫名 檔案 4.備份時,排除某張表的 mysqldump u...

資料庫匯入匯出

啥 也不說了。資料的匯出 1 將資料庫 test 完全匯出 使用者名稱 system 密碼manager 匯出到d daochu.dmp中 exp system manager test file d daochu.dmp full y 2 將資料庫中 system 使用者與sys 使用者的表匯出 ...

資料庫匯入匯出

檢視檔案位置 select from dba directories 建立 create or replace directory my dir as usr datapump create or replace directory my logdir as usr logs 匯出單個例項 expd...