I'm trying to add a column to store JSON objects in my MySQL database.
My configuration is as follows:
Versión de MySQL: 5.6.32-78.1. Engine de la tabla: MyIsam. Base de datos alojada en un hosting compartido (Bluehost)
I've tried it this way:
ALTER TABLE 'liturgia_horas_completas_salmos'
ADD COLUMN 'json_data' JSON AFTER 'salmos';
And throw me the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JSON AFTER
salmos
' at line 2
I have also created a column of type TEXT
:
ALTER TABLE 'liturgia_horas_completas_salmos'
ADD COLUMN 'json_data' TEXT AFTER 'salmos';
It is created well, then I enter a valid json in it and try to change it to JSON like this:
ALTER TABLE 'liturgia_horas_completas_salmos' MODIFY 'json_data' JSON;
And I also get an error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JSON' at line 1
What could I do to have a column with JSON data type?