http://blog.csdn.net/linwaterbin/article/category/1299332 mysqldump -S /tmp/mysql.sock --single-transaction --force --databases test > v1.sql
[[email protected] data]# cat v1.sql -- MySQL dump 10.13 Distrib 5.6.28, for Linux (x86_64) -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 5.6.28-debug-log /*!40101 SET @[email protected]@CHARACTER_SET_CLIENT */; /*!40101 SET @[email protected]@CHARACTER_SET_RESULTS */; /*!40101 SET @[email protected]@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @[email protected]@TIME_ZONE */; /*!40103 SET TIME_ZONE=‘+00:00‘ */; /*!40014 SET @[email protected]@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @[email protected]@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @[email protected]@SQL_MODE, SQL_MODE=‘NO_AUTO_VALUE_ON_ZERO‘ */; /*!40111 SET @[email protected]@SQL_NOTES, SQL_NOTES=0 */; -- -- Current Database: `test` -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE `test`; -- -- Table structure for table `user` -- DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( `id` varchar(20) NOT NULL, `name` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user` -- LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; INSERT INTO `user` VALUES (‘1‘,‘Michael‘); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET [email protected]_TIME_ZONE */; /*!40101 SET [email protected]_SQL_MODE */; /*!40014 SET [email protected]_FOREIGN_KEY_CHECKS */; /*!40014 SET [email protected]_UNIQUE_CHECKS */; /*!40101 SET [email protected]_CHARACTER_SET_CLIENT */; /*!40101 SET [email protected]_CHARACTER_SET_RESULTS */; /*!40101 SET [email protected]_COLLATION_CONNECTION */; /*!40111 SET [email protected]_SQL_NOTES */; -- Dump completed on 2016-07-08 6:12:19
general_log:生成的日志
[[email protected] data]# cat localhost.log mysqld, Version: 5.6.28-debug-log (Source distribution). started with: Tcp port: 3306 Unix socket: /tmp/mysql.sock Time Id Command Argument 160708 6:12:18 8 Connect root@localhost on 8 Query /*!40100 SET @@SQL_MODE=‘‘ */ 8 Query /*!40103 SET TIME_ZONE=‘+00:00‘ */ 8 Query SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ RR级别 8 Query START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */ 开始一个事务 8 Query SHOW VARIABLES LIKE ‘gtid\_mode‘ 8 Query UNLOCK TABLES 8 Query SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = ‘UNDO LOG‘ AND FILE_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = ‘DATAFILE‘ AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN (‘test‘))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE ORDER BY LOGFILE_GROUP_NAME 8 Query SELECT DISTINCT TABLESPACE_NAME, FILE_NAME, LOGFILE_GROUP_NAME, EXTENT_SIZE, INITIAL_SIZE, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = ‘DATAFILE‘ AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN (‘test‘)) ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME 8 Query SHOW VARIABLES LIKE ‘ndbinfo\_version‘ 8 Init DB test 8 Query SHOW CREATE DATABASE IF NOT EXISTS `test` 8 Query SAVEPOINT sp // save sp 8 Query show tables 8 Query show table status like ‘user‘ 8 Query SET SQL_QUOTE_SHOW_CREATE=1 8 Query SET SESSION character_set_results = ‘binary‘ 8 Query show create table `user` 8 Query SET SESSION character_set_results = ‘utf8‘ 8 Query show fields from `user` 8 Query SELECT /*!40001 SQL_NO_CACHE */ * FROM `user` 8 Query SET SESSION character_set_results = ‘binary‘ 8 Query use `test` 8 Query select @@collation_database 8 Query SHOW TRIGGERS LIKE ‘user‘ 8 Query SET SESSION character_set_results = ‘utf8‘ 8 Query ROLLBACK TO SAVEPOINT sp 8 Query RELEASE SAVEPOINT sp 160708 6:12:19 8 Quit
时间: 2024-10-20 08:35:57