I have a database with set of generated stored columns. When i exporting the database, the sql file comes with the generated column also. I'm using the adminer as the mysql client. Now the problem is import section. If i try to import that sql file, it gives such errors like
The value specified for generated column 'field_name' in table 'table_name' is not allowed.
Table creation
CREATE TABLE `table_name` (
`id` bigint NOT NULL AUTO_INCREMENT,
`field_name` text,
`generated_field` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (CONCAT('hello ', `field_name`)) STORED
);
Error thrown query is
INSERT INTO `table_name` (`id`, `field_name`, `generated_field`) VALUES (1, 'James', 'hello James')
I got the solution by using a simple way. Just i removed the generated column from insert query. Now it's working. Because the generated column only used for gettin the data from the mysql server
INSERT INTO `table_name` (`id`, `field_name`) VALUES (1, 'James')
***But what is the exact solution for gettin the clear export file for import it to the sql server without any errors
Because this is too difficult for the large sql data set