Reputation: 7748
Having this table using mysql 5.7:
CREATE TABLE `emails` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`subject` varchar(191) COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
When I try to insert some emojis:
INSERT INTO `emails` (`from_address`, `subject`) VALUES (1, 'A😀B C👨🏽🎨D')
I receive:
Incorrect string value: '\xF0\x9F\x98\x80B ...' for column 'subject' at row 1
Why? if i'm using utfmb?
Upvotes: 1
Views: 314
Reputation: 572
Is your connection also utf8mb4? Detailed explanation of this can be found at: https://mathiasbynens.be/notes/mysql-utf8mb4
Upvotes: 2