Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: playground v7.2.0 启动集群,使用SQLyog或者Navicat工具,都不能实现数据的备份与恢复
![](https://asktug.com/letter_avatar_proxy/v4/letter/t/dfb087/120.png)
【 TiDB Environment 】Development environment (TiDB is running in Ubuntu 22.04.2 LTS x86_64 (Py3.7.8) environment)
【 TiDB Version 】v7.2.0
【 SQLyog Version 】v12.14
【 Reproduction Process 】
-
First, export the existing data table
-
The exported SQL file code is as follows:
CREATE DATABASE `my_db_test`;
USE `my_db_test`;
DROP TABLE IF EXISTS `system`;
CREATE TABLE `system` (
`id` bigint(20) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */ COMMENT 'id',
`name` varchar(100) NOT NULL COMMENT 'system name',
`code` varchar(50) NOT NULL COMMENT 'system identifier',
`url` varchar(240) DEFAULT NULL COMMENT 'pc website',
`wap_url` varchar(240) DEFAULT NULL COMMENT 'mobile website',
`description` varchar(200) DEFAULT NULL COMMENT 'system description',
`status` smallint(6) NOT NULL COMMENT 'system status 1 normal, 2 closed',
`err_info` varchar(200) DEFAULT NULL COMMENT 'status description, explained here when system status is 2',
`create_at` bigint(20) DEFAULT '0' COMMENT 'creation time',
`update_at` bigint(20) DEFAULT '0' COMMENT 'update time',
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY `uniq_system_name_idx` (`name`),
UNIQUE KEY `uniq_system_code_idx` (`code`),
KEY `key_system_create_at_idx` (`create_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![auto_rand_base] AUTO_RANDOM_BASE=30001 */ COMMENT='system table';
insert into `system`(`id`,`name`,`code`,`url`,`wap_url`,`description`,`status`,`err_info`,`create_at`,`update_at`) values
(864691128455135233,'system1','aa1','http://aa.aa1.com',NULL,'',1,'',1678559006,1682836025),
(1152921504606846978,'system2','aa2','http://aa.aa2.com',NULL,'',1,NULL,1684570450,1684570450),
(4611686018427387911,'system3','aa3','http://aa.aa3.com',NULL,'',1,NULL,0,0),
(5188146770730811396,'system4','aa4','http://aa.aa4.com',NULL,'',1,'',1678558726,1682835989),
(5764607523034234886,'system5','aa5','http://aa.aa5.com',NULL,'',1,'',1678559039,1682836014),
(8358680908399640579,'system6','aa6','http://aa.aa6.com',NULL,'',1,'normal',1683995048,1684424721),
(8358680908399640581,'system7','aa7','http://aa.aa7.com',NULL,'',1,NULL,1684570340,1684570340);
- Run the above code to restore the data, and the following error occurs
Error Code: 8216
Invalid auto random: Explicit insertion on auto_random column is disabled. Try to set @@allow_auto_random_explicit_insert = true.
- If you use Navicat to export and then import, the problem mentioned in this post will occur
https://asktug.com/t/topic/1009883/17
Can’t commonly used tools perform backup and restore for TiDB?