• 数据库的表备份与恢复


    把数据导入到指定的文件:
    table expression
    into outfile 'filename' <选项名称> |
    into dumpfile 'filename' |
    into <user variable> <,....>
    <选项名称>: fields [terminated by [literal] ] ....
    	     lines terminated by <literal>	
    as:
    select *
    from test
    into outfile 'test.txt'
    把test 数据导入到 test.txt文件,在linux 下,test.txt和test表的存放位置相同
    默认值中:
    fields terminated by ' '
    lines terminated by ' '
    enclosed by ''
    escapsed by '\' as: select * from test into outfile 'test.txt' fields terminated by ',' lines terminated by '?' 表示导出的数据中,字段之间用 ','分隔,行之间用 '?'分隔 as: select * from test into outfile 'test.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '?' 表示字符是用 '"'包围的,如果全部用'"'包围,则不用加上 optionally 也可用dumpfile,但是所有行彼此挨着,值与行之间没有任何标志 as: select * from test into 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' replace into table test; as: load data infile 'test.txt' replace into table test fields terminated by ',' line terminated by '?'
  • 相关阅读:
    Linux安装cx_Oracle
    LVM分区
    命令行重启远程桌面服务
    常用Linux命令
    自动清理N天前的二进制日志
    MySQL常用操作
    Java里的堆(heap)栈(stack)和方法区(method)
    SpringMVC 八大注解
    Spring Cloud原理详解
    java线程的生命周期及五种基本状态
  • 原文地址:https://www.cnblogs.com/lin3615/p/4166255.html
Copyright © 2020-2023  润新知