Flávio Leal
Flávio Leal

Reputation: 363

MYSQL UTF8 Accents insensitive search

I need to do an accent insensitive search at my database. The table collation is UTF8.

At my table I have this data.

mysql> select * from categoria;

+------+
| name |
+------+
| Eletrônicos   |
| Informática   |
| Acessórios    |
+------+

I would like to do a search without accents and be able to return the data.

I'm trying to do this search:

Select name from categoria where name like '%eletronicos%'

But the query didn't return any row!

Someone knows how can I do that?

Explaining better

The problem is that the data were stored on database encoded as UTF8.

**Correct word with accent:** Eletrônicos
**Stored at database like:** Eletrônicos
**Searched word without accents** Eletronicos

Best, Flavio

Upvotes: 1

Views: 2969

Answers (1)

Syneo
Syneo

Reputation: 61

Try to switch your collation to utf8_general_ci, who is case and accent insensitive

Upvotes: 2

Related Questions