我有一个归类问题。它影响此表的3列,creation_date,product_id和lastmodified。带有类似问题的MySQL归类操作
我已将列更改为utf8mb4,但他们不接受它。请看下面。
CREATE TABLE `users` (
`id` int(32) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`creation_date` datetime DEFAULT NULL,
`product_id` int(32) DEFAULT NULL,
`lastmodified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=121 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
的查询:
select * from users u where u.name like '%philėp%'
No errors, 1 row.
select * from users u where u.creation_date like '%philėp%'
Illegal mix of collations for operation 'like'
MySQL的系统变量:
它的工作时,我手动强制MySQL的列转换在声明。
select * from users u where CONVERT(u.creation_date USING utf8mb4) like '%philėp%'
No errors; 0 rows;
它是不是utf8mb4格式?
希望有任何帮助。
你怎么能有这样的创建日期? 'u.creation_date like'%philėp%'' – bonCodigo
只是想知道排序规则 –