mysql介绍2种查询表字符集编码的方法。1、利用show columns语句配合full关键字查看当前数据库中指定表中所有列的字符集编码;2、利用show table status语句查看指定表的字符集编码。
1、利用show columns语句配合full关键字查看当前数据库中指定表中所有列的字符集编码
show full columns from 表名;
mysql> show full columns from 表名;
+-------+----------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| 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)
2、利用show table status语句查看指定表的字符集编码
show table status from 库名 like 表名;
mysql> show table status from 库名 like 表名;
+-----------+--------+---------+------------+------+----------------+-------------------------+-------------+------------+-----------------+----------+-
| 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)
以上是编程学习网小编为您介绍的“mysql介绍2种查询表字符集编码的方法”的全面内容,想了解更多关于 mysql 内容,请继续关注编程基础学习网。
编程基础网
本文标题为:mysql介绍2种查询表字符集编码的方法
基础教程推荐
猜你喜欢
- mysql查询优化之100万条数据的一张表优化方案 2023-12-13
- springboot配置mysql数据库spring.datasource.url报错的解决 2023-12-30
- Doris Join 优化原理文档详解 2023-12-11
- PostgreSQL的日期时间差DATEDIFF实例详解 2023-07-22
- 如何在SpringBoot中使用Redis实现分布式锁 2023-07-13
- 一文带你了解Redis怎么启动以及使用 2023-07-13
- Redis(五):Redis的持久化 2023-09-12
- 项目适 Oracle改造及SSL安全性配置问题汇总详解 2023-07-23
- [Redis] redis的hash类型底层结构哈希表 2024-03-09
- mysql数据库常见的优化操作总结(经验分享) 2023-12-30
