Languages
[Edit]
EN

MySQL - Create table with JSON field

0 points
Created by:
illona
526

In this article, we would like to show you how to create table with JSON field in MySQL.

Quick solution:

CREATE TABLE `table_name` (
	`column_name` JSON
);

Practical example

In this example, we create objects table with id and json column which will be JSON type.

Query:

CREATE TABLE `objects` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`json` JSON,
	PRIMARY KEY (`id`)
);

after we insert some values, we get the following result:

MySQL - create table with JSON field result
MySQL - create table with JSON field result

Note:

Go to this article to see how to insert JSON type values to the table.

Related posts

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

MySQL - Problems

MySQL - Create table with JSON field
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join