1

MySQL server version:

mysqld Ver 5.7.26 for Linux on x86_64 (MySQL Community Server (GPL))

MariaDB mysqldump CLI version:

mysqldump Ver 10.17 Distrib 10.3.12-MariaDB, for Linux (x86_64)

I am using this mysqldump version to take dump from the mentioned mysqld version. Data is around 25 gb.

I am getting below error while importing the dump,

ERROR 3105 (HY000) at line 82: The value specified for generated column 'column_name' in table 'table_name' is not allowed.

Source and destination mysql server is same version.

Command used to dump,

mysqldump -h mysql -P 3306 -uroot -px xxxxxxx --databases db_name

Total number of characters in Line 82 is around 80k, line starts with,

INSERT INTO table_name (ID, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, xxxxx, xxxxx, XXXXX) VALUES (5541,1,4852,'2018-11-12 09:30:25.306','{\"id\": 1108

Output from show create table, for the column throwing error:

column_name varchar(45) COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (json_unquote(json_extract(OPTIONS,'$.type'))) VIRTUAL,

Can we use MariaDB mysqldump CLI to take dump from MySQL Community version?

1

1 Answer 1

0

MariaDB JSON functions are different from MySQL ones.

  1. Manually create the equivalent table in MariaDB-10.3.
  2. remove the DROP TABLE {tablename} /CREATE TABLE {tablename} from your mysqldump output.
  3. import the edited mysqldump file.

If there are a lot of these generated columns, suggest doing a mysqldump --no-data and getting the syntax of all the tables correct first.

Not the answer you're looking for? Browse other questions tagged or ask your own question.