mysql8设置字段内容区分大小写

2021/12/12 19:17:55

本文主要是介绍mysql8设置字段内容区分大小写,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

要点如下:将要区分大小写的字段上直接设置如下内容

CHARACTER SET utf8mb4 COLLATE utf8mb4_bin  字段设置为区分大小写、

 

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for chentest
-- ----------------------------
DROP TABLE IF EXISTS `chentest`;
CREATE TABLE `chentest`  (
  `id` int(0) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of chentest
-- ----------------------------
INSERT INTO `chentest` VALUES (1, 'chen');
INSERT INTO `chentest` VALUES (2, 'CHen');
INSERT INTO `chentest` VALUES (3, 'ChEN');

SET FOREIGN_KEY_CHECKS = 1;



这篇关于mysql8设置字段内容区分大小写的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程