当前位置:网站首页>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如何查询表的字符集编码”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
边栏推荐
- 2022 software evaluator examination outline
- 【R语言数据科学】:文本挖掘(以特朗普推文数据为例)
- 外部自动(PLC启动机器人)
- 0基础自学STM32(野火)——使用寄存器点亮LED——GPIO功能框图讲解
- Étalonnage de la caméra monoculaire et de la caméra binoculaire à l'aide de l'outil d'étalonnage kalibr
- 为什么信息化 ≠ 数字化?终于有人讲明白了
- Actual combat | magical conic gradient
- MySQL highly available cluster – MHA
- Paper notes: e (n) equivariant graph neural networks
- What are the Commonwealth countries
猜你喜欢
随机推荐
XAMPP Apache安装时问题总结
About harbor private warehouse forgetting the login password
KUKA机器人外部轴配置你一定要知道的那些知识
首批!腾讯云通过中国信通院政务协同平台解决方案能力评估
微信小程序开发储备知识
InheritableThreadLocal 在线程池中进行父子线程间消息传递出现消息丢失的解析
regular expression
[untitled]
Help MySQL data analysis with databend
6.25atcoderabc257e - addition and multiplication 2
最高81.98%!超百所“双一流”高校本科深造率公布
深度剖析monai(一) Data和Transforms部分
正则表达式
固定资产管理系统让企业动态掌握资产情况
Summary of problems during xampp Apache installation
Advanced webgl performance optimization
“授权同意”落地压力大?隐私计算提供一种可能的合规“技术解”
【现代信号处理第六次作业】
Function calculation asynchronous task capability introduction - task trigger de duplication
C language microblog user management system









![[untitled]](/img/e2/be57a7e22275af59183c50e0710837.png)