With MySql 8 you can import json data directly with jsondata flag with the --import command. This is the official link: https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-json-import-command.html
But how do you import specific fields in the json data to specific column of an already defined table.
For eg: If you have a countries table with (id, code, name) and a json file with structure like
[
{
id: 1,
code: "foo",
name: "bar",
otherField1: "baz",
otherField2: "baz2"
},
{
...
}
]