zoukankan      html  css  js  c++  java
  • mysqldump --tab=path参数使用

    [root@zstedu tmp]# chown -R mysql. /tmp/andyxi3306/

    [root@zstedu tmp]# mysqldump -h127.0.0.1 -uroot -p --single-transaction --add-drop-database --tab="/tmp/andyxi3306/" andyxi3306 Enter password:

    Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database.

    If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.

    SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN; SET @@SESSION.SQL_LOG_BIN= 0;

    -- -- GTID state at the beginning of the backup --

    SET @@GLOBAL.GTID_PURGED='7f308b50-7701-11e8-8ee3-000c2923f3c9:1-31115'; SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

    [root@zstedu tmp]# cd andyxi3306/
    [root@zstedu andyxi3306]# ll
    total 947000
    -rw-r--r-- 1 root  root      1506 Jul  8 09:12 sbtest10.sql
    -rw-rw-rw- 1 mysql mysql 96888885 Jul  8 09:12 sbtest10.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest1.sql
    -rw-rw-rw- 1 mysql mysql 96888883 Jul  8 09:12 sbtest1.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest2.sql
    -rw-rw-rw- 1 mysql mysql 96888884 Jul  8 09:12 sbtest2.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest3.sql
    -rw-rw-rw- 1 mysql mysql 96888889 Jul  8 09:12 sbtest3.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest4.sql
    -rw-rw-rw- 1 mysql mysql 96888886 Jul  8 09:12 sbtest4.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest5.sql
    -rw-rw-rw- 1 mysql mysql 96888883 Jul  8 09:12 sbtest5.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest6.sql
    -rw-rw-rw- 1 mysql mysql 96888883 Jul  8 09:12 sbtest6.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest7.sql
    -rw-rw-rw- 1 mysql mysql 96888892 Jul  8 09:12 sbtest7.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest8.sql
    -rw-rw-rw- 1 mysql mysql 96888880 Jul  8 09:12 sbtest8.txt
    -rw-r--r-- 1 root  root      1502 Jul  8 09:12 sbtest9.sql
    -rw-rw-rw- 1 mysql mysql 96888885 Jul  8 09:13 sbtest9.txt
    -rw-r--r-- 1 root  root      1342 Jul  8 09:13 t1_1.sql
    -rw-rw-rw- 1 mysql mysql        0 Jul  8 09:13 t1_1.txt

    原因:

    此参数会创建一个包含create table语句的table_name.sql文件,和包含数据的tb1_name.txt文件。

    (1)cat t1.sql:

    [root@zstedu andyxi3306]# cat t1.sql -- MySQL dump 10.13  Distrib 5.7.22, for linux-glibc2.12 (x86_64) -- -- Host: 127.0.0.1    Database: andyxi3306 -- ------------------------------------------------------ -- Server version       5.7.22-log

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

    -- -- Table structure for table `t1` --

    DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client     = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` (   `id` int(11) DEFAULT NULL,   `cc` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */;

    /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

    -- Dump completed on 2018-07-

    (2)t1.txt是数据文件,内容较大。

    [root@zstedu andyxi3306]# more t1.txt
    1       c4ca4238a0b923820dcc509a6f75849b
    2       c81e728d9d4c2f636f067f89cc14862c
    3       eccbc87e4b5ce2fe28308fd9f2a7baf3
    4       a87ff679a2f3e71d9181a67b7542122c
    5       e4da3b7fbbce2345d7772b0674a318d5
    6       1679091c5a880faf6fb5e6087eb1b2dc
    7       8f14e45fceea167a5a36dedd4bea2543
    8       c9f0f895fb98ab9159f51fd0297e236d
    9       45c48cce2e2d7fbdea1afc51c7c6ad26
    10      d3d9446802a44259755d38e6d163e820
    11      6512bd43d9caa6e02c990b0a82652dca
    12      c20ad4d76fe97759aa27a0c99bff6710
    13      c51ce410c124a10e0db5e4b97fc2af39
    14      aab3238922bcc25a6f606eb525ffdc56
    15      9bf31c7ff062936a96d3c8bd1f8f2ff3
    16      c74d97b01eae257e44aa9d5bade97baf
    17      70efdf2ec9b086079795c442636b55fb

  • 相关阅读:
    git(1)-git关联GitHub-windows-转载
    jenkins(4)-jenkins配置邮件通知
    jenkins(3)-linux下安装jenkins(yum install方式)
    【PAT甲级】1090 Highest Price in Supply Chain (25 分)(DFS)
    【PAT甲级】1087 All Roads Lead to Rome (30 分)(MAP【int,string】,邻接表,DFS,模拟,SPFA)
    【PAT甲级】1018 Public Bike Management (30 分)(DFS,SPFA)
    Educational Codeforces Round 61 (Rated for Div. 2) G(线段树,单调栈)
    Atcoder Grand Contest 032C(欧拉回路,DFS判环)
    Educational Codeforces Round 62 (Rated for Div. 2)E(染色DP,构造,思维,组合数学)
    Atcoder Grand Contest 031C(构造,思维,异或,DFS)
  • 原文地址:https://www.cnblogs.com/chinaops/p/9279012.html
Copyright © 2011-2022 走看看