mysqldatabasedockermysql-workbenchmysql-error-1146

Error on MYSQL Workbench trying to import a dump folder of existing tables in a new database


In my short developer live i have managed my MySQL with Workbench , cause is what really vialize my process on developing without being an expertise on Database managament. In this last project im involved at , after building my app i set each an every module of it (microservices) on a image of a docker container , and as this project is managed by a relational database , i did also pulled a mysql image. Done this i create a copy of my testing database (a dump folder with all tables), in order to be imported in my new mysqldocker image once the container set to run. enter image description here But for some reason i can't understand still any time i try to import to my running mysql docker container all the data exported previously, this error for each and every table shows up:


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

Apparently the folder where all tables are imported isn't recognized. I got to the directory, and i checked each and every table in there , and all of them contain the corresponding data, as example the table of products:

-- 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

The image database is running perfectly, thus i discard any problem with no running database. Also connection was tested working perfectly: enter image description here

enter image description here enter image description here

I always have used Workbench of MYSQl to handle this situation of importing and exporting databases and working with , casue i'm not an expertise on relational databases. Could some body help me ?


Solution

  • The dump you are showing us is not including the table definition and this lead to the error

    ERROR 1146 (42S02) at line 22: Table 'multirenter.renter_role' doesn't exist

    either recreate the table before running the dump or recreate the dump including the table definition