当前位置:网站首页>mysql如何查询表的字符集编码
mysql如何查询表的字符集编码
2022-06-29 17:16:00 【亿速云】
mysql如何查询表的字符集编码
这篇文章主要介绍了mysql如何查询表的字符集编码的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇mysql如何查询表的字符集编码文章都会有所收获,下面我们一起来看看吧。
mysql查询表字符集编码的两种方法:1、使用“show table status”语句查看指定数据库中指定表的字符集编码,语法“show table status from 库名 like 表名;”。2、使用“show columns”语句配合full关键字查看当前数据库中指定表所有列的字符集编码,语法“show full columns from 表名;”。
本教程操作环境:windows7系统、mysql8版本、Dell G3电脑。
mysql查询表字符集编码的两种方法
1、使用show table status语句查看指定表的字符集编码
SHOW TABLE STATUS命令可以获取指定数据库中每个数据表的信息,包括字符集编码。
show table status from 数据库名;
但只想获取指定表的信息,就可利用like进行限制:
show table status from 库名 like 表名;
示例:查看class_7数据库中test_info表的字符集编码
show table status from class_7 like 'test_info';
mysql> show table status from class_7 like 'test_info';+-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+-| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_leate_time | Update_time | Check_time | Collation | Checksum | +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+-| test_info | InnoDB | 10 | Compact | 10 | 1638 | 17-12-05 19:01:55 | NULL | NULL | utf8_general_ci | NULL | +-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+-1 row in set (0.00 sec)

2、使用show columns语句配合full关键字查看当前数据库中指定表中所有列的字符集编码
在mysql中,SHOW COLUMNS命令可以显示表的列信息,而要获取有关列的更多信息,请将FULL关键字添加到SHOW COLUMNS命令中:
show full columns from 表名;
该语句可以输出指定表中所有列的字符集编码
示例:查看test_info表中所有列的字符集编码
show full columns from test_info;
mysql> show full columns from test_info;+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+| id | int(3) | NULL | NO | PRI | NULL | | select,insert,update,references | || name | char(12) | utf8_general_ci | YES | | NULL | | select,insert,update,references | || dorm | char(10) | utf8_general_ci | YES | | NULL | | select,insert,update,references | || addr | char(12) | utf8_general_ci | YES | | 未知 | | select,insert,update,references | || score | int(3) | NULL | YES | | NULL | | select,insert,update,references | |+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+5 rows in set (0.00 sec)

关于“mysql如何查询表的字符集编码”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“mysql如何查询表的字符集编码”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
边栏推荐
- Information | Zuckerberg was rated as the most careless CEO in the global IT industry; China Mobile R & D tethered UAV emergency communication high altitude base station
- A user level thread library based on C language
- LeetCode 每日一题——535. TinyURL 的加密与解密
- How to establish and use KUKA subroutines / functions
- controller、service、dao之间的关系
- curl: (56) Recv failure: Connection reset by peer
- 函数计算异步任务能力介绍 - 任务触发去重
- C language practice ---- pointer string and linked list
- 基于C语言开发实现的一个用户级线程库
- 如何在 PowerPoint 中向幻灯片添加 SmartArt?
猜你喜欢

Redis 原理 - Sorted Set (ZSet)

Inheritablethreadlocal resolves message loss during message transmission between parent and child threads in the thread pool

Calibration of monocular camera and binocular camera with kalibr calibration tool

Étalonnage de la caméra monoculaire et de la caméra binoculaire à l'aide de l'outil d'étalonnage kalibr

机器学习7-支持向量机

controller、service、dao之间的关系

NVIDIA安装最新显卡驱动

如何创建虚拟形象

【R语言数据科学】:文本挖掘(以特朗普推文数据为例)

适合中小企业的项目管理系统有哪些?
随机推荐
我的远程办公初体验 | 社区征文
Basics | draw arcs in the physics engine
机器学习7-支持向量机
Development of freedom free agreement pledge mining system
kotlin基础语法
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
Practice | solution for image upload, rotation and compression on mobile terminal
Tencent cloud released the upgraded version of CDW Clickhouse to provide a fast experience for massive data real-time analysis scenarios
Collaborative development of epidemic home outsourcing project 𞓜 community essay solicitation
2022 software evaluator examination outline
Simulink simulation mode
【Oracle】基础知识面试题
机器学习8-人工神经网络
基于opencv进行双目相机的标定
Redis principle - sorted set (Zset)
@Difference between component and @configuration
【南京大学】考研初试复试资料分享
PCB板框的绘制——AD19
Calibration of binocular camera based on OpenCV
广发易淘金和东方财富哪个更好,更安全一些