# MYSQL\_JSON

{% hint style="info" %}
The `TYPE_MYSQL_JSON` plugin is available from [MariaDB 10.5.7](https://app.gitbook.com/s/aEnK0ZXmUbJzqQrTjFyb/community-server/old-releases/10.5/10.5.7).
{% endhint %}

The JSON type in MySQL stores the JSON object in its own native form, while, in MariaDB, the [JSON type](https://mariadb.com/docs/server/reference/data-types/string-data-types/json) is a [LONGTEXT](https://mariadb.com/docs/server/reference/data-types/string-data-types/longtext). Opening a table with a JSON type created in MySQL results in an error:

```sql
SELECT * FROM mysql_json_table;
ERROR 4161 (HY000): Unknown data type: 'MYSQL_JSON'
```

The `mysql_json` plugin is used to make it easier to upgrade to MariaDB.

## Installing

Installing can be done in a [number of ways](https://mariadb.com/docs/server/reference/plugin-overview#installing-a-plugin), for example:

```sql
INSTALL SONAME 'type_mysql_json';
```

See [Making MariaDB understand MySQL JSON](https://mariadb.org/making-mariadb-understand-mysql-json/) for a full description.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
