I want to store Unicode characters in mysql database what should i do.
I tried using charset settings but not working. please tell me some procedure to achive this.
We assume we have a DB with table articles, and a column named posts, which will save the article written in your blog. Best part, we know that all major DB’s support UTF8. And we shall explore that feature.
Now we write a article in hindi, हेल्लो वर्ल्ड
If the UTF8 is not specified, you should see something like ?????? in ur DB else u shud see the hindi data.
First check for UTF8 compatibility with this query. If it supports you should see the output as
SHOW VARIABLES LIKE
Now that being checked, alter the table and just modify the column, Posts in our above example and specify it as UTF8
ALTER TABLE articles MODIFY Posts VARCHAR(20) CHARACTER SET UTF8;
Now, try to insert the hindi value and save it. Query it and u shud see the hindi text