首页 > 代码库 > 数据库的表备份与恢复
数据库的表备份与恢复
把数据导入到指定的文件:table expressioninto outfile ‘filename‘ <选项名称> |into dumpfile ‘filename‘ |into <user variable> <,....><选项名称>: fields [terminated by [literal] ] .... lines terminated by <literal> as:select *from testinto outfile ‘test.txt‘把test 数据导入到 test.txt文件,在linux 下,test.txt和test表的存放位置相同默认值中:
fields terminated by ‘\t‘
lines terminated by ‘\n‘
enclosed by ‘‘
escapsed by ‘\\‘ as:select *from testinto outfile ‘test.txt‘fields terminated by ‘,‘lines terminated by ‘?‘表示导出的数据中,字段之间用 ‘,‘分隔,行之间用 ‘?‘分隔as:select * from testinto outfile ‘test.txt‘fields terminated by ‘,‘optionally enclosed by ‘"‘lines terminated by ‘?‘表示字符是用 ‘"‘包围的,如果全部用‘"‘包围,则不用加上 optionally也可用dumpfile,但是所有行彼此挨着,值与行之间没有任何标志as:select *from testinto dumpfile ‘test.dump‘载入数据数据表中load data [low_priority][concurrent][local]infile ‘filename‘[replace]into table tablename[fields terminated by literal][lines terminated by literal]as:load data infile ‘test.txt‘replaceinto table test;as:load data infile ‘test.txt‘replaceinto table testfields terminated by ‘,‘line terminated by ‘?‘
数据库的表备份与恢复
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。