普通备份
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqldump -uroot -p test > f:\test_bak_1009.sql
也可以
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqldump -uroot -p test > f:\test_bak_1009.dump
导出的文件
-- MySQL dump 10.13 Distrib 5.6.11, for Win64 (x86_64) -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 5.6.11 /*!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 `oauth2_client` -- DROP TABLE IF EXISTS `oauth2_client`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `oauth2_client` ( `id` int(11) NOT NULL AUTO_INCREMENT, `client_name` varchar(25) DEFAULT NULL, `client_id` varchar(25) DEFAULT NULL, `client_secret` varchar(25) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `oauth2_client` -- LOCK TABLES `oauth2_client` WRITE; /*!40000 ALTER TABLE `oauth2_client` DISABLE KEYS */; /*!40000 ALTER TABLE `oauth2_client` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `oauth2_user` -- DROP TABLE IF EXISTS `oauth2_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `oauth2_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(25) DEFAULT NULL, `password` varchar(25) DEFAULT NULL, `salt` varchar(25) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `oauth2_user` -- LOCK TABLES `oauth2_user` WRITE; /*!40000 ALTER TABLE `oauth2_user` DISABLE KEYS */; /*!40000 ALTER TABLE `oauth2_user` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `permission` -- DROP TABLE IF EXISTS `permission`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `permission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pname` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `permission` -- LOCK TABLES `permission` WRITE; /*!40000 ALTER TABLE `permission` DISABLE KEYS */; INSERT INTO `permission` VALUES (1,'检验员'),(2,'管理员'); /*!40000 ALTER TABLE `permission` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `role` -- DROP TABLE IF EXISTS `role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rname` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `role` -- LOCK TABLES `role` WRITE; /*!40000 ALTER TABLE `role` DISABLE KEYS */; INSERT INTO `role` VALUES (1,'上传文件'),(2,'下载文件'); /*!40000 ALTER TABLE `role` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sessions` -- DROP TABLE IF EXISTS `sessions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sessions` ( `id` varchar(50) NOT NULL, `session` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sessions` -- LOCK TABLES `sessions` WRITE; /*!40000 ALTER TABLE `sessions` DISABLE KEYS */; /*!40000 ALTER TABLE `sessions` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sys_user` -- DROP TABLE IF EXISTS `sys_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sys_user` ( `id` varchar(30) NOT NULL, `username` varchar(55) DEFAULT NULL, `password` varchar(80) DEFAULT NULL, `sex` varchar(5) DEFAULT NULL, `mail` varchar(55) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL, `title` varchar(10) DEFAULT NULL, `role_id` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sys_user` -- LOCK TABLES `sys_user` WRITE; /*!40000 ALTER TABLE `sys_user` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_user` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_run_as` -- DROP TABLE IF EXISTS `user_run_as`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_run_as` ( `from_user_id` int(11) NOT NULL, `to_user_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_run_as` -- LOCK TABLES `user_run_as` WRITE; /*!40000 ALTER TABLE `user_run_as` DISABLE KEYS */; /*!40000 ALTER TABLE `user_run_as` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!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