当前位置:网站首页>How to eliminate the character set and sorting rules specially set for fields in MySQL tables?
How to eliminate the character set and sorting rules specially set for fields in MySQL tables?
2022-07-24 12:02:00 【Shawn】
Hope the column is in line with the table
Other answers 1:
Reassign the field character set ( Collation default )
CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `serial_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;alter table t1 modify `serial_no` varchar(50) CHARACTER SET utf8mb4 NOT NULL;show create table t1;/*CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `serial_no` varchar(50) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4*/Other answers 2:
mysql There are statements that can reassign the full table character set .
CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `serial_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Execute statement :
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4;
CREATE TABLE t1 (id int NOT NULL AUTO_INCREMENT,serial_no varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
Introduction to official documents
To change the table default character set and all character columns (CHAR, VARCHAR, TEXT) to a new character set, use a statement like this:
ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;
边栏推荐
- 3、 Implementation principle of MFC message mapping mechanism
- 08.01 adjacency matrix
- 使用Prometheus+Grafana实时监控服务器性能
- Basic syntax of MySQL DDL and DML and DQL
- Use of multithreading in QT
- Cgo+gsoap+onvif learning summary: 9. Go and C conduct socket communication and onvif protocol processing
- Operational amplifier - Notes on rapid recovery [1] (parameters)
- 一周精彩内容分享(第13期)
- Learning materials about red team
- One week's wonderful content sharing (issue 13)
猜你喜欢

Source code analysis sentry user behavior record implementation process
![Operational amplifier - Notes on rapid recovery [II] (application)](/img/fd/e12f43e23e6ec76c2b44ce7813e204.png)
Operational amplifier - Notes on rapid recovery [II] (application)

Recommended SSH cross platform terminal tool tabby

6k+ star,面向小白的深度学习代码库!一行代码实现所有Attention机制!

Jmeter-While控制器

第1章 引言
![Detailed OSPF configuration of layer 3 switch / router [Huawei ENSP experiment]](/img/a9/f080940ec7bf94ab83c922990efa62.png)
Detailed OSPF configuration of layer 3 switch / router [Huawei ENSP experiment]

3、 Implementation principle of MFC message mapping mechanism

JMeter while controller

生信周刊第37期
随机推荐
Linked list - 142. Ring linked list II
Source code analysis sentry user behavior record implementation process
Please ask whether Oracle CDC does not support checkpointing. When the task is suspended and restarted during the real-time collection process, is the data changed
Repeated calls, messages, idempotent schemes, full collation
Blue team resource collection
在kuborad图形化界面中,操作Kubernetes 集群,实现mysql中的主从复制
源码分析Sentry用户行为记录实现过程
Shell Scripting tips
Detailed OSPF configuration of layer 3 switch / router [Huawei ENSP experiment]
Open source DNS software powerdns BIND9 mydns
[QNX hypervisor 2.2 user manual]9.2 CmdLine
L1-043 阅览室
Convergence rules for 4 * 4 image weights
哈希——18. 四数之和
The difference between synchronized and lock locks
【C和指针第11章】动态内存分配
Operational amplifier - Notes on rapid recovery [II] (application)
Introduction to Devops and common Devops tools
Time processing of basic library in go
Leetcode:51. queen n