ITPub博客

首页 > 数据库 > MySQL > mysqldump --result-file参数

mysqldump --result-file参数

原创 MySQL 作者:huzhichengforce 时间:2015-03-31 22:03:00 0 删除 编辑
使用mysqldump 备份时 有一个参数--result-file 官方解释为Direct output to a given file 直接输入到给定的文件。
我们在备份时
mysql -uroot -p1qazxsw2 -S /var/lib/mysql/mysql.sock test >test.sql 可以重定向到test文件下面
而--result-file 参数的意义就是代替上面的方法
打开一个终端:1
[root@mysql ~]# mysqldump -uroot -p1qazxsw2 -S /var/lib/mysql/mysql.sock test --result-file=/data01/result.sql
Warning: Using a password on the command line interface can be insecure.
完成备份后
打开一个终端2:目录下面已经有了我们备份的文件。
[root@mysql data01]# ll
total 793028
-rw-r--r-- 1 root root 802072615 Mar 28 10:31 huzhichengfull.sql
drwx------ 2 root root     16384 Feb  3 05:44 lost+found
-rw-r--r-- 1 root root         0 Mar 29 10:10 p.sql
-rw-r--r-- 1 root root   9963741 Mar 29 10:13 result.sql

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26764973/viewspace-1480781/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: mysql_config_editor
请登录后发表评论 登录
全部评论

注册时间:2012-08-19

  • 博文量
    202
  • 访问量
    518270