I am running a MySQL 5.6.26 on Windows 2012R2, in mysql.ini everything is configured to use UTF-8 Unicode (utf8).
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
I use this table:
CREATE TABLE IF NOT EXISTS `wcf1_guildtool_playerdata` (
`charID` int(11) NOT NULL,
`charname` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`realmname` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`class` int(11) DEFAULT NULL,
`race` int(11) DEFAULT NULL,
`gender` int(11) NOT NULL,
`level` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
When I perform the following SQL command:
SELECT * FROM wcf1_guildtool_playerdata WHERE charname LIKE 'Veneanâr'
the database returns me this data:
118 Veneanar Forscherliga 3 5 0 56
But it should return nothing, because there is no entry for "Veneanâr".
This problem occurs in my PHP Script (using PDO Statement) in PHPMyAdmin and even in the mysql command line.
My PHP script checks if a charname already exists and performs an update, if not it creates a new entry. I have to create "Veneanar" and "Veneanâr" but while MySQL claims there is already an "Veneanâr" (what is not true) the script updates the entry with wrong data.
I cannot understand why this happens. Is there any problem with my mysql configuration?