Reputation: 2819
My Table collation is utf8_general_ci
and character set is utf8
. If I run a query like the following, it does not show me any value.
SELECT * FROM mytable WHERE myfield = "Björn Borg"
OR myfield = "FrüFrü & Tigerlily";
So how I can fetch the values from table ?
Upvotes: 1
Views: 2473
Reputation: 18358
The problem can be in your connection charset. Try to run
SET NAMES 'utf8mb4'
And then your query.
Upvotes: 1
Reputation: 1259
There are more places where MySQL defines character sets, including at the column level.
To check the database settings: SHOW VARIABLES LIKE 'char%'; SHOW VARIABLES LIKE 'collation%';
To check the table settings: SHOW CREATE TABLE tablename;
To check the individual columns: SHOW FULL COLUMNS IN tablename;
If you created a database with the wrong encoding, you will have to change every single occurence of a bad charset in all of these.
Upvotes: 0