Unable to query with Chinese character
Posted by: Lamarche Lam
Date: January 08, 2021 03:32AM

Hello everyone,
I'm new to MySQL so I was practicing with a MySQL tutorial

There was a question in this tutorial requiring us to query a record using LIKE operator so I did it as:

select
Tname
from Teacher
where Tname like '李%';

and the result was Tname: (nothing showed up except the column name).
(All databases and tables in this tutorial was set to utf8 before any query was performed)



Some suggested me to set the encoding in the configuration file (my.cnf) into utf8 and so I add:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
character-set-server=utf8

in the my.cnf file and apply it in the system preference panel.




However, it does't work at all.
Could somebody please show me a way out of this?
Thank you so much.

Options: ReplyQuote


Subject
Views
Written By
Posted
Unable to query with Chinese character
919
January 08, 2021 03:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.