I keep getting an error when trying to run a statement for the MySql database. What I am trying to do is change column name's type from BLOB to JSON.
Here is the statement:
ALTER TABLE `main_db`.`main_table`
CHANGE COLUMN `name` `name` JSON CHARACTER SET 'utf8mb4' NULL DEFAULT NULL ;
This is something that workbench automatically created for me and when I ran it... I get this error:
Operation failed: There was an error while applying the SQL script to the database.
Executing:
ALTER TABLE `main_db`.`main_table`
CHANGE COLUMN `name` `name` JSON CHARACTER SET 'utf8mb4' NULL DEFAULT NULL ;
ERROR 1064: 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 'CHARACTER SET 'utf8mb4' NULL DEFAULT NULL' at line 2
SQL Statement:
ALTER TABLE `main_db`.`main_table`
CHANGE COLUMN `name` `name` JSON CHARACTER SET 'utf8mb4' NULL DEFAULT NULL
Any help will be appreciated.
Thanks :)
ERROR 3144: Cannot create a JSON value from a string with CHARACTER SET 'binary'. SQL Statement: ALTER TABLE `main_db`.`main_table` MODIFY `name` JSON – dani.nykh Feb 18 '17 at 18:23