每天进步一点点—mysql-mysqldump
一、 简单介绍
mysqldump是client用来备份数据库或者在不通数据库之间进行数据迁移的工具,备份内容包括创建表或者装载表的SQL语句
二、 命令格式
备份单个数据库或者数据库中部分数据表
mysqldump [參数] 数据库名 [表名]
备份指定的一个或者多个数据库
mysqldump [參数] --database db1 [db2db3]
备份全部数据库
mysqldump [參数] --all-database
三、 经常使用參数
-u--user=name username
-p --password 密码
-h --host=hostname 指定serverIP或者可解析到的域名
-P--port 端口
--add-drop-database 每一个数据库创建语句前加上drop database,用于创建新库前将旧库删掉
--add-drop-table 在每一个创建表前加上drop table语句。用于创建新表前删除旧表
-n--no-create-db 不包括数据库创建语句
-t --no-create-info 不包括数据表创建语句
-d --no-data 不包括数据
--compact 将输出的结果简洁,不包含默认选项中的各种凝视
-c--complete-insert 在insert语句中加上字段名(默认不加)
-F --flush-logs 备份前刷新日志,使得方便恢复。
-l --lock-tables 给全部表加入读锁保证数据一致性一般与-F配合使用
-T 此參数与以下參数配合使用,此參数是将数据备份为淡出的数据文本文档和建表的SQL两个文件
--filelds-terminated-by=name(域分隔符)
--filelds-enclosed-by=name(域引用符)
--fields-optionally-enclosed-by=name(域可选引用符)
--fields-escaped-by=name(转义字符)
--default-characte-set=字符类型 此选项能够设置导出的client字符集,系统默认client字符集能够通过 mysql --verbose --help |grep 'default-character-set'|grep-v name来查看所以一般导出的时候一定要将字符集设置对。
四、 经常使用样例
1) 备份T4表到test4.txt
[root@localhost data]# mysqldump -h10.22.19.44 -uroot-p test2 t4 >test4.txt
2) 备份教务表
[root@localhostdata]# mysqldump -h10.22.19.44 -uroot -p jiaowu >jiaowu.txt
3) 仅仅导出表的创建语句,不包括其它信息
[root@localhostdata]# mysqldump -h10.22.19.44 -uroot -p -d test2 t4 >nodata.txt
Enter password:
[root@localhost data]# cat nodata.txt
-- MySQL dump 10.13 Distrib 5.6.12, for linux-glibc2.5 (x86_64)
--
-- Host: 10.22.19.44 Database: test2
--------------------------------------------------------
-- Server version 5.6.12-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' */;
/*!40014 SET@OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET@OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES,SQL_NOTES=0 */;
--
-- Table structure for table `t4`
--
DROP TABLE IF EXISTS `t4`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `t4` (
`id` int(10) NOT NULL DEFAULT '0',
`str_number` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SETFOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SETUNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-07-17 14:53:49
4) 仅仅导出表的创建语句,而且加入删除旧表的语句
[root@localhostdata]# mysqldump -h10.22.19.44 -uroot -p -d --add-drop-table jiaowu tutors>nooldtable.txt
Enter password:
[root@localhostdata]# cat nooldtable.txt
-- MySQL dump 10.13 Distrib 5.6.12, for linux-glibc2.5 (x86_64)
--
-- Host: 10.22.19.44 Database: jiaowu
-- ------------------------------------------------------
-- Server version 5.6.12-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' */;
/*!40014 SET@OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET@OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES,SQL_NOTES=0 */;
--
-- Table structure for table `tutors`
--
DROP TABLE IF EXISTS `tutors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(50) NOT NULL,
`Gender` enum('F','M') DEFAULT 'M',
`Age` tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SETFOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SETUNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-07-17 14:57:03
5) 将上面的结果通过简洁的方式输出
[root@localhostdata]# mysqldump -h10.22.19.44 -uroot -p -d --compact --add-drop-table jiaowututors >compactnooldtable.txt
Enter password:
[root@localhostdata]# cat compactnooldtable.txt
DROP TABLE IF EXISTS `tutors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(50) NOT NULL,
`Gender` enum('F','M') DEFAULT 'M',
`Age` tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
6) 通过简洁方式将tutors导出,而且在insert into语句上加入字段名
[root@localhostdata]# mysqldump -h10.22.19.44 -uroot -p -c jiaowu tutors>completetutors.txt
Enterpassword:
[root@localhostdata]# cat completetutors.txt
-- MySQL dump 10.13 Distrib 5.6.12, for linux-glibc2.5 (x86_64)
--
-- Host: 10.22.19.44 Database: jiaowu
--------------------------------------------------------
-- Server version 5.6.12-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' */;
/*!40014 SET@OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES,SQL_NOTES=0 */;
--
-- Table structure for table `tutors`
--
DROP TABLE IF EXISTS `tutors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(50) NOT NULL,
`Gender` enum('F','M') DEFAULT 'M',
`Age`tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
--
-- Dumping data for table `tutors`
--
LOCK TABLES `tutors` WRITE;
/*!40000 ALTER TABLE `tutors` DISABLE KEYS*/;
INSERT INTO `tutors` (`TID`, `Tname`,`Gender`, `Age`) VALUES(1,'HongQigong','M',93),(2,'HuangYaoshi','M',63),(3,'Miejueshitai','F',72),(4,'OuYangfeng','M',76),(5,'YiDeng','M',90),(6,'YuCanghai','M',56),(7,'Jinlunfawang','M',67),(8,'HuYidao','M',42),(9,'NingZhongze','F',49),(10,'TOM','F',30),(11,'DingDian','M',25),(12,'HuFei','M',31),(13,'Xuzhu','M',26),(18,'DingDian','M',25),(19,'HuFei','M',31),(20,'Xuzhu','M',26),(23,'stu0010','M',NULL),(24,'stu0012','M',NULL),(25,'str000023','M',NULL),(26,'str000024','M',NULL),(27,'str9999','M',NULL),(28,'str9991','M',NULL),(29,'str9992','M',NULL),(30,'str9993','M',NULL);
/*!40000 ALTER TABLE `tutors` ENABLE KEYS*/;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SETFOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SETUNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS*/;
/*!40101 SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-07-17 15:03:30
[root@localhost data]# mysqldump-h10.22.19.44 -uroot -p --compact -c jiaowu tutors >completetutors.txt
Enter password:
[root@localhost data]# catcompletetutors.txt
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(50) NOT NULL,
`Gender` enum('F','M') DEFAULT 'M',
`Age` tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
INSERT INTO `tutors` (`TID`, `Tname`,`Gender`, `Age`) VALUES(1,'HongQigong','M',93),(2,'HuangYaoshi','M',63),(3,'Miejueshitai','F',72),(4,'OuYangfeng','M',76),(5,'YiDeng','M',90),(6,'YuCanghai','M',56),(7,'Jinlunfawang','M',67),(8,'HuYidao','M',42),(9,'NingZhongze','F',49),(10,'TOM','F',30),(11,'DingDian','M',25),(12,'HuFei','M',31),(13,'Xuzhu','M',26),(18,'DingDian','M',25),(19,'HuFei','M',31),(20,'Xuzhu','M',26),(23,'stu0010','M',NULL),(24,'stu0012','M',NULL),(25,'str000023','M',NULL),(26,'str000024','M',NULL),(27,'str9999','M',NULL),(28,'str9991','M',NULL),(29,'str9992','M',NULL),(30,'str9993','M',NULL);
7) 将tutors导出为单纯的文本文件和建表SQL
[root@localhostdata]# mkdir bak
[root@localhostdata]# chown mysql:mysql ./bak/
[root@localhostdata]# mysqldump -uroot -p123456 jiaowu tutors -T ./bak/
Warning: Using a password on the commandline interface can be insecure.
[root@localhost data]# cat./bak/tutors.sql
-- MySQL dump 10.13 Distrib 5.6.12, for linux-glibc2.5 (x86_64)
--
-- Host: localhost Database: jiaowu
--------------------------------------------------------
-- Server version 5.6.12-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 `tutors`
--
DROP TABLE IF EXISTS `tutors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(50) NOT NULL,
`Gender` enum('F','M') DEFAULT 'M',
`Age` tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40101 SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-07-17 15:14:21
[root@localhostdata]# cat ./bak/tutors.txt
1 HongQigong M 93
2 HuangYaoshi M 63
3 Miejueshitai F 72
4 OuYangfeng M 76
5 YiDeng M 90
6 YuCanghai M 56
7 Jinlunfawang M 67
8 HuYidao M 42
9 NingZhongze F 49
10 TOM F 30
11 DingDian M 25
12 HuFei M 31
13 Xuzhu M 26
18 DingDian M 25
19 HuFei M 31
20 Xuzhu M 26
23 stu0010 M \N
24 stu0012 M \N
25 str000023 M \N
26 str000024 M \N
27 str9999 M \N
28 str9991 M \N
29 str9992 M \N
30 str9993 M \N
在向文件夹中导出文件时,有时候会提示以下错误
[root@localhost data]# mysqldump -uroot-p123456 test2 t4 -T ./bak/
Warning: Using a password onthe command line interface can be insecure.
mysqldump: Got error: 1: Can'tcreate/write to file '/usr/local/mysql/data/bak/t4.txt' (Errcode: 13 -Permission denied) when executing 'SELECT INTO OUTFILE'
报出此错是因为文件夹没有足够权限导致,仅仅需给文件夹足够权限就可以
[root@localhost data]# chownmysql:mysql ./bak/
[root@localhost data]# mysqldump -uroot -p123456 jiaowu tutors -T ./bak/
Warning: Using a password on the command lineinterface can be insecure.
8) 导出含有中文的数据。不加參数会导致数据中有乱码
[root@localhostdata]# mysqldump -uroot -p123456 --compact jiaowu tutors >test5
Warning: Using a password on the commandline interface can be insecure.
[root@localhostdata]# cat test5
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(200) DEFAULT NULL,
`Gender`enum('F','M') DEFAULT 'M',
`Age` tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
INSERT INTO `tutors` VALUES (1,'HongQigong','M',93),(2,'HuangYaoshi','M',63),(3,'Miejueshitai','F',72),(4,'OuYangfeng','M',76),(5,'YiDeng','M',90),(6,'YuCanghai','M',56),(7,'Jinlunfawang','M',67),(8,'HuYidao','M',42),(9,'NingZhongze','F',49),(10,'TOM','F',30),(11,'DingDian','M',25),(12,'HuFei','M',31),(13,'Xuzhu','M',26),(18,'DingDian','M',25),(19,'HuFei','M',31),(20,'Xuzhu','M',26),(23,'stu0010','M',NULL),(24,'stu0012','M',NULL),(25,'str000023','M',NULL),(26,'str000024','M',NULL),(27,'str9999','M',NULL),(28,'str9991','M',NULL),(29,'str9992','M',NULL),(30,'str9993','M',NULL),(32,'ä¸å›½','M',21),(33,'ç–¯å','M',21),(34,'å‚»å','M',21);
能够看到导出的数据是乱码
[root@localhostdata]# mysqldump -uroot -p123456 --compact --default-character-set=latin1jiaowu tutors >test6
Warning: Using a password on the commandline interface can be insecure.
[root@localhostdata]# cat test6
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8*/;
CREATE TABLE `tutors` (
`TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Tname` varchar(200) DEFAULT NULL,
`Gender` enum('F','M') DEFAULT 'M',
`Age` tinyint(3) unsigned DEFAULT NULL,
UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULTCHARSET=latin1;
/*!40101 SET character_set_client =@saved_cs_client */;
INSERT INTO `tutors` VALUES(1,'HongQigong','M',93),(2,'HuangYaoshi','M',63),(3,'Miejueshitai','F',72),(4,'OuYangfeng','M',76),(5,'YiDeng','M',90),(6,'YuCanghai','M',56),(7,'Jinlunfawang','M',67),(8,'HuYidao','M',42),(9,'NingZhongze','F',49),(10,'TOM','F',30),(11,'DingDian','M',25),(12,'HuFei','M',31),(13,'Xuzhu','M',26),(18,'DingDian','M',25),(19,'HuFei','M',31),(20,'Xuzhu','M',26),(23,'stu0010','M',NULL),(24,'stu0012','M',NULL),(25,'str000023','M',NULL),(26,'str000024','M',NULL),(27,'str9999','M',NULL),(28,'str9991','M',NULL),(29,'str9992','M',NULL),(30,'str9993','M',NULL),(32,'中国','M',21),(33,'疯子','M',21),(34,'傻子','M',21);
能够看到设置编码后,导出的数据为正确的中文字符
9) 备份前锁定表而且刷新备份日志
备份前查看二进制日志号:
mysql>show master status;
+--------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB |Binlog_Ignore_DB | Executed_Gtid_Set |
+--------------+----------+--------------+------------------+-------------------+
| mysql.000009 | 120 | | | |
+--------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
[root@localhostdata]# mysqldump -uroot -p123456 --compact -F -l jiaowu >jiaowu.sql
Warning: Using a password on the commandline interface can be insecure.
备份后查看二进制日志号
mysql>show master status;
+--------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB |Binlog_Ignore_DB | Executed_Gtid_Set |
+--------------+----------+--------------+------------------+-------------------+
| mysql.000011 | 120 | | | |
+--------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
导出请大家解决小弟问题
/*!50530 SET@@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET@OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
#at 4
#150717 16:06:16 server id 1 end_log_pos 120 CRC32 0x8f464488 Start: binlog v 4, server v 5.6.12-log created 150717 16:06:16
BINLOG '
eLeoVQ8BAAAAdAAAAHgAAAAAAAQANS42LjEyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAYhE
Ro8=
'/*!*/;
#at 120
#150717 16:06:16 server id 1 end_log_pos 163 CRC32 0xf497faf6 Rotate to mysql.000013 pos: 4
DELIMITER ;
#End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
~
每天进步一点点—mysql-mysqldump的更多相关文章
- MySQL mysqldump数据导出详解
介绍 在日常维护工作当中经常会需要对数据进行导出操作,而mysqldump是导出数据过程中使用非常频繁的一个工具:它自带的功能参数非常多,文章中会列举出一些常用的操作,在文章末尾会将所有的参数详细说明 ...
- MySQL mysqldump数据导出详解 --dump-slave 注意事项
http://www.cnblogs.com/chenmh/p/5300370.html 介绍 在日常维护工作当中经常会需要对数据进行导出操作,而mysqldump是导出数据过程中使用非常频繁的一个工 ...
- mysql mysqldump只导出表结构或只导出数据的实现方法
mysql mysqldump只导出表结构或只导出数据的实现方法,需要的朋友可以参考下. mysql mysqldump 只导出表结构 不导出数据 复制代码代码如下: mysqldump --opt ...
- c# Process cmd 执行完回调 Proc_OutputDataReceived mysql mysqldump mysql source备份还原数据
c# Process 执行完回调 Proc_OutputDataReceived mysql mysqldump mysql source备份还原数据 直接贴代码 前提:mysql5.7 vs2017 ...
- MySQL mysqldump与source导入慢的解决方法
Jquery中文网 > 数据库 > mysql > 正文 MySQL mysqldump与source导入慢的解决方法 MySQL mysqldump与source导入慢的 ...
- [mysql] mysqldump 导出数据库表
1.mysqldump的几种常用方法: (1)导出整个数据库(包括数据库中的数据) mysqldump -u username -p dbname > dbname.sql (2)导出数据库结构 ...
- 二十、mysql mysqldump备份工具
.备份所有数据库 mysqldump -uroot -p --all-database > c:\all.sql 备份所有数据库到c盘下的all,sql文件 .备份某个数据库 mysqldump ...
- MySQL mysqldump 导入/导出 结构&数据&存储过程&函数&事件&触发器
———————————————-库操作———————————————-1.①导出一个库结构 mysqldump -d dbname -u root -p > xxx.sql ②导出多个库结构 m ...
- MySQL mysqldump 数据备份
1.mysqldump 命令工具说明 参数注解: mysqldump 是采用SQL 级别的备份机制,它将数据表导成 SQL 脚本文件,在不同的 MySQL 版本之间升级时相对比较合适,这也是最常用的备 ...
- MySQL mysqldump数据导出基本操作
mysqldump mysqldump命令是mysql数据库中备份工具,用于将MySQL服务器中的数据库以标准的sql语言的方式导出,并保存到文件中. 选项 --all-databases, -A:导 ...
随机推荐
- python基础003
1. list 1.1 基础 list是一组有序的集合序列,可以包含任何类型且不必相同,并支持嵌套.采用如下创建方式: li = ["spam",2.0,5,[10,20]] 列表 ...
- C第10章-----通过引用传递
#include <stdio.h> #include <math.h> void metersToFeetAndInches(double meters,unsigned i ...
- 剑指Offer(书):数组中重复的数字
题目:找出数组中重复的数字. 说明:在一个长度为n的数组里的所有数字都在0~n-1的范围内,数组中某些数字是重复的,但是不知道有几个数字重复了,也不知道每个数字重复了几次.请找出数组中任意一个重复的数 ...
- poj 1780 , poj 1392 欧拉回路求前后相互衔接的数字串
两道题目意思差不多 第一题是10进制 , 第二题是2进制的 都是利用欧拉回路的fleury算法来解决 因为我总是希望小的排在前面,所以我总是先将较小数加入栈,再利用另一个数组接收答案,但是这里再从栈中 ...
- [POJ1797] Heavy Transportation(最大生成树 || 最短路变形)
传送门 1.最大生成树 可以求出最大生成树,其中权值最小的边即为答案. 2.最短路 只需改变spfa里面的松弛操作就可以求出答案. ——代码 #include <queue> #inclu ...
- poj2446 Chessboard 【最大匹配】
题目大意:一个n*m的棋盘,某些格子不能用,问用1*2的骨牌能否完全覆盖这个棋盘,当然,骨牌不能有重叠 思路:显然黑白染色后,一个骨牌只能覆盖一个白色格子和一个黑色格子,然后我们间二染色建图,看能否有 ...
- codeforces 315B
#include<stdio.h> int main() { int n,k,i,flag=0; while(scanf("%d%d",&n,&k)!= ...
- msp430项目编程12
msp430中项目---温度检测系统 1.ds18b20工作原理 2.电路原理说明 3.代码(显示部分) 4.代码(功能实现) 5.项目总结 msp430项目编程 msp430入门学习
- 由八数码问题引入。对BFS有更深考虑
12号到今天共研究八数码问题poj1077,首先用的是普通BFS,遇到很多问题,开始用一个二级指针作为结构成员,知道了二级指针与二维数值名的不同!http://write.blog.csdn.net/ ...
- Codeforces Round #291 (Div. 2) B. Han Solo and Lazer Gun
因为是x,y均为整数因此对于同一直线的点,其最简分数x/y是相同的(y可以为0,这里不做除法)于是将这些点不断求最简分数用pair在set中去重即可. #include <cmath> # ...