Say I have:
ID Title
------------------------------------------------------
| 1 | ماهر زين |
------------------------------------------------------
Currently it's data type is set to VARCHAR(255)
with collation=utf8-default collation
.
Based On research I had I found that You have to have Table column with the data type set to NVARCHAR
to be able to store unicode or arabic characters. So I tried to change the Data Type of my column to NVARCHAR
But it gives this error:
Query:
ALTER TABLE `db`.`table`
CHANGE COLUMN `NAME` `NAME` NVARCHAR(255) CHARACTER SET 'utf8' NULL DEFAULT NULL ;
Error:
Operation failed: There was an error while applying the SQL script to the database. Executing: ALTER TABLE
db
.table
CHANGE COLUMNNAME
NAME
NVARCHAR(255) CHARACTER SET 'utf8' 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 'utf8' NULL DEFAULT NULL' at line 2 SQL Statement: ALTER TABLE
db
.table
CHANGE COLUMNNAME
NAME
NVARCHAR(255) CHARACTER SET 'utf8' NULL DEFAULT NULL
FYI: I'm doing this conversion with MySql workbench manually.