M
M
Michael2018-11-21 22:59:22
MySQL
Michael, 2018-11-21 22:59:22

Why is json not supported in mysql?

Mysql >5.7.8 supports json. It was 5.6, updated to 5.7 to support json. System: cent os 6 (aws ec2).

mysql --version
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper

Package mysql57-5.7.23-2.9.amzn1.x86_64 already installed and latest version

When I try to add a JSON field
ALTER TABLE mytable ADD COLUMN `data` JSON

#1064 - You have an error in your request. Check the documentation for your version of MySQL for the correct syntax near 'JSON' on line 2

I can not understand why mysql does not add a field, although there should be support. Where is the mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2018-11-21
@springimport

I understood the problem. I do not know how this is possible, but on the server there are 2 versions of mysql. The mysql --version command uses the new one, but the application uses the old one.
I thought when installing a new one, it updates and takes data from the old one, but apparently in cent os it's somehow different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question