0

I have a table linkmapper with a single column keyword. Table collation is utf8mb4_unicode_ci. I tried to execute the following command.

insert into linkmapper (keyword) values("There’s is a demo");

Later I used the select command to see the content of the table.

mysql> select keyword from linkmapper;
+-------------------+
| keyword           |
+-------------------+
| There?s is a demo |
+-------------------+

Here you can see that special character is replaced by ?.

PS: This problem is just arising on my localhost WAMP machine. On production, everything is working as expected.

  • Does this answer your question? [How do I see what character set a MySQL database / table / column is?](https://stackoverflow.com/questions/1049728/how-do-i-see-what-character-set-a-mysql-database-table-column-is) – JosefZ Nov 17 '21 at 19:29
  • Hi, Already mentioned charset and collation. It does not answer. – saurabh yadav Nov 17 '21 at 19:42
  • Did you type `SET names utf8mb4` first? – Evert Nov 17 '21 at 20:46
  • @Evert Now getting this after setting as you said. mysql> select keyword from linkmapper limit 1; +---------------------+ | keyword | +---------------------+ | ThereÔÇÖs is a demo | +---------------------+ – saurabh yadav Nov 17 '21 at 21:20
  • What terminal application are you viewing this in? Is it configured for utf-8? – Evert Nov 17 '21 at 21:30
  • Mysql console from wamp – saurabh yadav Nov 17 '21 at 22:48
  • See "question mark" in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Nov 20 '21 at 01:19

1 Answers1

0

This is a problem with the encoding, maybe using utf8_general_ci can solve it.

How to do it: https://www.a2hosting.com.br/kb/developer-corner/mysql/convert-mysql-database-utf-8