Mysql数据库导出命令:
mysqldump -uroot -p123456 -h localhost -P3306 tyzk_cg --hex-blob>> D:/data/tyzk_cg_dev.20230809.sql 2>&1 &
文件内容:脚本里没有创建数据库,则在执行source命令之前必须执行 use 数据库 命令
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- MySQL dump 10.13 Distrib 5.7.34, for Win64 (x86_64)
--
-- Host: localhost Database: tyzk_cg
-- ------------------------------------------------------
-- Server version 5.7.34-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 `a_process_config`
--
DROP TABLE IF EXISTS `a_process_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `a_process_config` (
`id` varchar(64) NOT NULL,
`process_name` varchar(255) DEFAULT NULL COMMENT '流程名称',
`process_key` varchar(255) DEFAULT NULL COMMENT '流程key',
`start_process_url` varchar(255) DEFAULT NULL COMMENT '流程启动表单页面地址',
`detail_url` varchar(255) DEFAULT NULL COMMENT '详情页面地址',
`process_workorder_type_num` int(11) DEFAULT '0' COMMENT '工单类型值',
`file_generate_time` datetime DEFAULT NULL COMMENT 'bpmn文件生成时间',
`deploy_time` datetime DEFAULT NULL COMMENT 'bpmn部署时间',
`create_by` varchar(64) DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`update_by` varchar(64) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`remarks` varchar(255) DEFAULT NULL,
`del_flag` int(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='activiti流程配置';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `a_process_config`
--
LOCK TABLES `a_process_config` WRITE;
/*!40000 ALTER TABLE `a_process_config` DISABLE KEYS */;
INSERT INTO `a_process_config` VALUES ('17b5c464017e4088ad4221bdfff1d59f','战略采购邀请招标','process_strategic_invitation',NULL,NULL,2,'2018-03-19 14:38:35','2018-08-28 21:37:07',NULL,'2018-08-28 21:37:07',NULL,'2018-08-28 21:37:07','战略采购-邀请招标',0),('1c2174327f364b97a6d79cad92ca955c','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-07-04 18:21:22','2018-07-04 18:21:22',NULL,'2018-07-04 18:21:22',NULL,'2018-07-04 18:21:22','专项采购-邀请招标',0),('1fc7e19cac664cf09d42373379ba3da1','专项采购零星采购','process_special_sporadic',NULL,NULL,4,'2018-07-04 18:20:06','2018-07-04 18:20:06',NULL,'2018-07-04 18:20:06',NULL,'2018-07-04 18:20:06','专项采购-零星采购',0),('59e831517f4e49d195a4bff37f9bd2b4','专项采购非战略直委','process_special_nonstrat_direct',NULL,NULL,6,'2018-07-04 18:21:00','2018-07-04 18:21:00',NULL,'2018-07-04 18:21:00',NULL,'2018-07-04 18:21:00','专项采购-非战略直委',0),('79429d98ccc349a9b5f9cbdefaf6d2b7','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-03-19 14:38:35',NULL,NULL,'2023-05-29 15:31:24',NULL,'2023-05-29 15:31:24','专项采购-竞争性谈判',0),('7f5e74a2c17a4067bc6da11812e99edc','战略采购竞争性谈判','process_strategic_competitive_negotiation',NULL,NULL,3,'2018-03-19 14:38:35','2019-10-10 06:41:50',NULL,'2019-10-10 06:41:50',NULL,'2019-10-10 06:41:50','战略采购-竞争性谈判',0),('8401eec6e983476694ccfb2717daafab','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35',NULL,NULL,'2023-05-26 17:46:41',NULL,'2023-05-26 17:46:41','专项采购-邀请招标',0),('85089eaeaad24810aca50de74d95eed9','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-03-19 14:38:35','2019-10-10 06:43:48',NULL,'2019-10-10 06:43:48',NULL,'2019-10-10 06:43:48','专项采购-竞争性谈判',0),('8eeeb7222a43412eb8edcfb55cc3b82f','专项采购战略直委','process_special_strat_direct',NULL,NULL,5,'2018-07-04 18:20:38','2018-07-04 18:20:38',NULL,'2018-07-04 18:20:38',NULL,'2018-07-04 18:20:38','专项采购-战略直委',0),('8f0cc36af8b143a3811cf8adbaed0331','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-03-19 14:38:35','2018-08-28 21:38:19',NULL,'2018-08-28 21:38:19',NULL,'2018-08-28 21:38:19','专项采购-竞争性谈判',0),('9a178be86c3d4761b357ff13e76b1b32','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-07-04 18:21:46','2018-07-04 18:21:46',NULL,'2018-07-04 18:21:46',NULL,'2018-07-04 18:21:46','专项采购-竞争性谈判',0),('d8ca4409774b4168a226e369160baf2f','战略采购竞争性谈判','process_strategic_competitive_negotiation',NULL,NULL,3,'2018-03-19 14:38:35','2018-08-28 21:37:31',NULL,'2018-08-28 21:37:31',NULL,'2018-08-28 21:37:31','战略采购-竞争性谈判',0),('e8a010c593924a7d803a56155051d6c7','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35',NULL,NULL,'2023-05-26 17:55:39',NULL,'2023-05-26 17:55:39','专项采购-邀请招标',0),('ec4f44212569497799453bddee2c8826','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35','2018-08-28 21:37:55',NULL,'2018-08-28 21:37:55',NULL,'2018-08-28 21:37:55','专项采购-邀请招标',0),('eff6650510404ea79985c2555c8601c4','战略采购直接委托','process_strategic_direct_entrust',NULL,NULL,1,'2018-03-19 14:38:35','2018-08-28 21:36:39',NULL,'2018-08-28 21:36:39',NULL,'2018-08-28 21:36:39','战略采购-直接委托',0),('f85070a234d3474e889428ff760e75ae','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35',NULL,NULL,'2023-05-26 17:58:56',NULL,'2023-05-26 17:58:56','专项采购-邀请招标',0);
/*!40000 ALTER TABLE `a_process_config` ENABLE KEYS */;
UNLOCK TABLES;
导出命令中包含建库脚本:比上文中导出命令多了 -B 参数
mysqldump -uroot -p123456 -h localhost -P3306 -B tyzk_cg --hex-blob>> D:/data/tyzk_cg_dev.20230809.sql 2>&1 &
脚本内容:
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- MySQL dump 10.13 Distrib 5.7.34, for Win64 (x86_64)
--
-- Host: localhost Database: tyzk_cg
-- ------------------------------------------------------
-- Server version 5.7.34-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 */;
--
-- Current Database: `tyzk_cg`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `tyzk_cg` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `tyzk_cg`;
--
-- Table structure for table `a_process_config`
--
DROP TABLE IF EXISTS `a_process_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `a_process_config` (
`id` varchar(64) NOT NULL,
`process_name` varchar(255) DEFAULT NULL COMMENT '流程名称',
`process_key` varchar(255) DEFAULT NULL COMMENT '流程key',
`start_process_url` varchar(255) DEFAULT NULL COMMENT '流程启动表单页面地址',
`detail_url` varchar(255) DEFAULT NULL COMMENT '详情页面地址',
`process_workorder_type_num` int(11) DEFAULT '0' COMMENT '工单类型值',
`file_generate_time` datetime DEFAULT NULL COMMENT 'bpmn文件生成时间',
`deploy_time` datetime DEFAULT NULL COMMENT 'bpmn部署时间',
`create_by` varchar(64) DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`update_by` varchar(64) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`remarks` varchar(255) DEFAULT NULL,
`del_flag` int(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='activiti流程配置';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `a_process_config`
--
LOCK TABLES `a_process_config` WRITE;
/*!40000 ALTER TABLE `a_process_config` DISABLE KEYS */;
INSERT INTO `a_process_config` VALUES ('17b5c464017e4088ad4221bdfff1d59f','战略采购邀请招标','process_strategic_invitation',NULL,NULL,2,'2018-03-19 14:38:35','2018-08-28 21:37:07',NULL,'2018-08-28 21:37:07',NULL,'2018-08-28 21:37:07','战略采购-邀请招标',0),('1c2174327f364b97a6d79cad92ca955c','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-07-04 18:21:22','2018-07-04 18:21:22',NULL,'2018-07-04 18:21:22',NULL,'2018-07-04 18:21:22','专项采购-邀请招标',0),('1fc7e19cac664cf09d42373379ba3da1','专项采购零星采购','process_special_sporadic',NULL,NULL,4,'2018-07-04 18:20:06','2018-07-04 18:20:06',NULL,'2018-07-04 18:20:06',NULL,'2018-07-04 18:20:06','专项采购-零星采购',0),('59e831517f4e49d195a4bff37f9bd2b4','专项采购非战略直委','process_special_nonstrat_direct',NULL,NULL,6,'2018-07-04 18:21:00','2018-07-04 18:21:00',NULL,'2018-07-04 18:21:00',NULL,'2018-07-04 18:21:00','专项采购-非战略直委',0),('79429d98ccc349a9b5f9cbdefaf6d2b7','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-03-19 14:38:35',NULL,NULL,'2023-05-29 15:31:24',NULL,'2023-05-29 15:31:24','专项采购-竞争性谈判',0),('7f5e74a2c17a4067bc6da11812e99edc','战略采购竞争性谈判','process_strategic_competitive_negotiation',NULL,NULL,3,'2018-03-19 14:38:35','2019-10-10 06:41:50',NULL,'2019-10-10 06:41:50',NULL,'2019-10-10 06:41:50','战略采购-竞争性谈判',0),('8401eec6e983476694ccfb2717daafab','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35',NULL,NULL,'2023-05-26 17:46:41',NULL,'2023-05-26 17:46:41','专项采购-邀请招标',0),('85089eaeaad24810aca50de74d95eed9','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-03-19 14:38:35','2019-10-10 06:43:48',NULL,'2019-10-10 06:43:48',NULL,'2019-10-10 06:43:48','专项采购-竞争性谈判',0),('8eeeb7222a43412eb8edcfb55cc3b82f','专项采购战略直委','process_special_strat_direct',NULL,NULL,5,'2018-07-04 18:20:38','2018-07-04 18:20:38',NULL,'2018-07-04 18:20:38',NULL,'2018-07-04 18:20:38','专项采购-战略直委',0),('8f0cc36af8b143a3811cf8adbaed0331','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-03-19 14:38:35','2018-08-28 21:38:19',NULL,'2018-08-28 21:38:19',NULL,'2018-08-28 21:38:19','专项采购-竞争性谈判',0),('9a178be86c3d4761b357ff13e76b1b32','专项采购竞争性谈判','process_special_competitive_negotiation',NULL,NULL,8,'2018-07-04 18:21:46','2018-07-04 18:21:46',NULL,'2018-07-04 18:21:46',NULL,'2018-07-04 18:21:46','专项采购-竞争性谈判',0),('d8ca4409774b4168a226e369160baf2f','战略采购竞争性谈判','process_strategic_competitive_negotiation',NULL,NULL,3,'2018-03-19 14:38:35','2018-08-28 21:37:31',NULL,'2018-08-28 21:37:31',NULL,'2018-08-28 21:37:31','战略采购-竞争性谈判',0),('e8a010c593924a7d803a56155051d6c7','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35',NULL,NULL,'2023-05-26 17:55:39',NULL,'2023-05-26 17:55:39','专项采购-邀请招标',0),('ec4f44212569497799453bddee2c8826','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35','2018-08-28 21:37:55',NULL,'2018-08-28 21:37:55',NULL,'2018-08-28 21:37:55','专项采购-邀请招标',0),('eff6650510404ea79985c2555c8601c4','战略采购直接委托','process_strategic_direct_entrust',NULL,NULL,1,'2018-03-19 14:38:35','2018-08-28 21:36:39',NULL,'2018-08-28 21:36:39',NULL,'2018-08-28 21:36:39','战略采购-直接委托',0),('f85070a234d3474e889428ff760e75ae','专项采购邀请招标','process_special_invitation',NULL,NULL,7,'2018-03-19 14:38:35',NULL,NULL,'2023-05-26 17:58:56',NULL,'2023-05-26 17:58:56','专项采购-邀请招标',0);
/*!40000 ALTER TABLE `a_process_config` ENABLE KEYS */;
UNLOCK TABLES;
数据库恢复:1、登录数据库;2:使用source xxx.备份脚本.sql ; 如果备份脚本没有带库名,则使用use xxx数据库名后再执行source。如果带库名,则使用use xxx库名 将不生效。
数据恢复时要特别注意是用哪种方式备份的,最好使用不带库名的方式。