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查询以某"字符串"开头的查询方式 2022-10-23
- CentOS7安装Redis4.0.2 2024-03-03
- Django权限系统auth模块用法解读 2023-07-28
- SQL窗口函数OVER用法实例整理 2022-10-23
- python-pymysql获取字段名称-获取内容方式 2023-07-27
- 【Redis 技术探索】「数据迁移实战」手把手教你如何实现在线 + 离线模式进行迁移Redis数据实战指南(离线同步数据) 2024-03-03
- MySQL数据同步出现Slave_IO_Running: No问题的解决 2023-07-27
- Dbeaver连接MySQL数据库及错误Connection refusedconnect处 2022-09-12
- 基于Spring中的事务@Transactional细节与易错点、幻读 2023-12-04
- MySQL压测神器HammerDB的部署及使用详解 2022-08-31