Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type not supported - The JSON data is not available before MySQL 5.7.8

I am running local MySQL instance version of 5.7.23 in Ubuntu-18-04. The DB is already having some tables having JSON fields to store JSON data. They working fine with insert, update and delete operations.

The issue comes when try to modify an existing table to have a new field to store JSON data. MySQL-Workbench is giving an error saying

Type not supported

The JSON data is not available before MySQL 5.7.8. In order to use it, first set the version for your model to 5.7.8 or higher

Following screen shots shows my local environment information.

The error: enter image description here

MySQL server info: enter image description here

MySQL Workbench info: enter image description here

like image 759
Shantha Kumara Avatar asked Sep 24 '18 12:09

Shantha Kumara


People also ask

Does MySQL 5.7 support JSON data type?

As of MySQL 5.7. 8, MySQL supports a native JSON data type defined by RFC 7159 that enables efficient access to data in JSON (JavaScript Object Notation) documents.

Which MySQL version support JSON data type?

MySQL version 5.7. 8 introduces a JSON data type that allows you to access data in JSON documents. SQL databases tend to be rigid in design.

Does MySQL 5.6 support JSON data type?

Yes , you can definitely to it using JSON_EXTRACT() function in mysql.


1 Answers

I was able to figure the issue. The default version set for Modeling MySQL was set as 5.6.30. Changed it to 5.7.8 and works the table schema modification.

Go to Edit -> Preferences... in MySQL Workbench

Refer the below screens:

Before: enter image description here

After: enter image description here

like image 100
Shantha Kumara Avatar answered Sep 24 '22 02:09

Shantha Kumara