MYSQL Workbench 尝试在新数据库中导入现有表的转储文件夹时出错
Error on MYSQL Workbench trying to import a dump folder of existing tables in a new database
在我短暂的开发人员生活中,我用 Workbench 管理了我的 MySQL ,因为真正实现了我的开发过程,而不是数据库管理方面的专业知识。
在我参与的最后一个项目中,在构建我的应用程序后,我在 docker 容器的图像上设置了它的每个模块(微服务),并且由于该项目由关系数据库管理,所以我也拉了mysql 图片。
这样做我创建了我的测试数据库的副本(一个包含所有 tables 的转储文件夹),以便在容器设置为 [=] 后导入我的新 mysqldocker 图像40=]。
但出于某种原因,我仍然无法理解任何时候我尝试将之前导出的所有数据导入我的 运行ning mysql docker 容器,每个 table 显示:
Operation failed with exitcode 1
14:05:57 Restoring multirenter (product_subtype)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmp377gxw.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_product_subtype.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.product_subtype' doesn't exist
Operation failed with exitcode 1
14:05:58 Restoring multirenter (product_type)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmph0b0bt.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_product_type.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.product_type' doesn't exist
Operation failed with exitcode 1
14:05:59 Restoring multirenter (rent)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpycsq97.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_rent.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.rent' doesn't exist
Operation failed with exitcode 1
14:06:00 Restoring multirenter (rent_notification)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmposezhe.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_rent_notification.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.rent_notification' doesn't exist
Operation failed with exitcode 1
14:06:01 Restoring multirenter (renter)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpi0zamm.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_renter.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.renter' doesn't exist
Operation failed with exitcode 1
14:06:02 Restoring multirenter (renter_role)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpxrcppi.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_renter_role.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.renter_role' doesn't exist
Operation failed with exitcode 1
14:06:03 Restoring multirenter (role)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpa9imev.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_role.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.role' doesn't exist
Operation failed with exitcode 1
14:06:04 Import of C:\Users\kikit\Documents\dumps\Dump20210226 has finished with 13 errors
显然无法识别导入所有 table 的文件夹。
我进入目录,我检查了那里的每个 table,它们都包含相应的数据,例如 table 的产品:
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: multirenter
-- ------------------------------------------------------
-- Server version 8.0.20
/*!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 */;
/*!50503 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 */;
--
-- Dumping data for table `product`
--
LOCK TABLES `product` WRITE;
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
INSERT INTO `product` VALUES (6,'Roller Blade 1',9,1,1,1,1,1),(9,'Periquito',8,4,2,1,2,2),(10,'chanclas',8,3,2,2,2,3),(11,'product test 1',8,3,2,2,2,3),(12,'product test 2',8,4,2,2,2,2),(13,'Blazer Roller Blades',8,1,1,2,1,1),(14,'Blazer Roller Blades',8,1,1,2,1,1),(15,'Roller Blades Bazer 11',8,1,1,2,1,1),(16,'Surf Board Hawai 2.0',8,28,4,2,3,3);
/*!40000 ALTER TABLE `product` 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 2021-02-26 13:36:50
图像数据库 运行ning 完美,因此我放弃了没有 运行ning 数据库的任何问题。还测试了连接完美运行:
enter image description here
我一直使用 Workbench 或 MYSQl 来处理这种导入和导出数据库以及使用 的情况,因为我不是关系数据库方面的专家。
有人可以帮助我吗?
您向我们展示的转储不包括 table 定义,这会导致错误
ERROR 1146 (42S02) at line 22: Table 'multirenter.renter_role' doesn't exist
在 运行 转储之前重新创建 table 或重新创建包含 table 定义的转储
在我短暂的开发人员生活中,我用 Workbench 管理了我的 MySQL ,因为真正实现了我的开发过程,而不是数据库管理方面的专业知识。
在我参与的最后一个项目中,在构建我的应用程序后,我在 docker 容器的图像上设置了它的每个模块(微服务),并且由于该项目由关系数据库管理,所以我也拉了mysql 图片。
这样做我创建了我的测试数据库的副本(一个包含所有 tables 的转储文件夹),以便在容器设置为 [=] 后导入我的新 mysqldocker 图像40=]。
Operation failed with exitcode 1
14:05:57 Restoring multirenter (product_subtype)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmp377gxw.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_product_subtype.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.product_subtype' doesn't exist
Operation failed with exitcode 1
14:05:58 Restoring multirenter (product_type)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmph0b0bt.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_product_type.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.product_type' doesn't exist
Operation failed with exitcode 1
14:05:59 Restoring multirenter (rent)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpycsq97.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_rent.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.rent' doesn't exist
Operation failed with exitcode 1
14:06:00 Restoring multirenter (rent_notification)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmposezhe.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_rent_notification.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.rent_notification' doesn't exist
Operation failed with exitcode 1
14:06:01 Restoring multirenter (renter)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpi0zamm.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_renter.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.renter' doesn't exist
Operation failed with exitcode 1
14:06:02 Restoring multirenter (renter_role)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpxrcppi.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_renter_role.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.renter_role' doesn't exist
Operation failed with exitcode 1
14:06:03 Restoring multirenter (role)
Running: mysql.exe --defaults-file="c:\users\kikit\appdata\local\temp\tmpa9imev.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments --database=multirenter < "C:\Users\kikit\Documents\dumps\Dump20210226\multirenter_role.sql"
ERROR 1146 (42S02) at line 22: Table 'multirenter.role' doesn't exist
Operation failed with exitcode 1
14:06:04 Import of C:\Users\kikit\Documents\dumps\Dump20210226 has finished with 13 errors
显然无法识别导入所有 table 的文件夹。 我进入目录,我检查了那里的每个 table,它们都包含相应的数据,例如 table 的产品:
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: multirenter
-- ------------------------------------------------------
-- Server version 8.0.20
/*!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 */;
/*!50503 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 */;
--
-- Dumping data for table `product`
--
LOCK TABLES `product` WRITE;
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
INSERT INTO `product` VALUES (6,'Roller Blade 1',9,1,1,1,1,1),(9,'Periquito',8,4,2,1,2,2),(10,'chanclas',8,3,2,2,2,3),(11,'product test 1',8,3,2,2,2,3),(12,'product test 2',8,4,2,2,2,2),(13,'Blazer Roller Blades',8,1,1,2,1,1),(14,'Blazer Roller Blades',8,1,1,2,1,1),(15,'Roller Blades Bazer 11',8,1,1,2,1,1),(16,'Surf Board Hawai 2.0',8,28,4,2,3,3);
/*!40000 ALTER TABLE `product` 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 2021-02-26 13:36:50
图像数据库 运行ning 完美,因此我放弃了没有 运行ning 数据库的任何问题。还测试了连接完美运行:
我一直使用 Workbench 或 MYSQl 来处理这种导入和导出数据库以及使用 的情况,因为我不是关系数据库方面的专家。 有人可以帮助我吗?
您向我们展示的转储不包括 table 定义,这会导致错误
ERROR 1146 (42S02) at line 22: Table 'multirenter.renter_role' doesn't exist
在 运行 转储之前重新创建 table 或重新创建包含 table 定义的转储