MySQL 的Comment命令行下面在哪里看?我用MySql Administrator看是乱码

iorikingdom 2009-07-13 04:30:47
MySQL 的Comment命令行下面在哪里看?我用MySql Administrator看是乱码
...全文
301 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ieagle77 2011-10-10
  • 打赏
  • 举报
回复
打酱油路过,学习了!
yyjt1987 2009-08-06
  • 打赏
  • 举报
回复
真郁闷,谁规定要回复的呀~!
ACMAIN_CHM 2009-07-13
  • 打赏
  • 举报
回复

中文估计是你的字符集设置了。mysql administrator 用得应该是utf8

mysql> show create table t_iorikingdom;
+---------------+---------------------------------------------------------------
| Table | Create Table
+---------------+---------------------------------------------------------------
| t_iorikingdom | CREATE TABLE `t_iorikingdom` (
`id` int(11) DEFAULT NULL COMMENT 'comment for id汉字',
`f1` char(1) DEFAULT NULL COMMENT 'comment for f1汉字'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='comment for table汉字' |
+---------------+---------------------------------------------------------------
1 row in set (0.06 sec)

mysql> show full columns from t_iorikingdom;
+-------+---------+-------------------+------+-----+-------....----+--------------------+
| Field | Type | Collation | Null | Key | Defaul.... | Comment |
+-------+---------+-------------------+------+-----+-------....----+--------------------+
| id | int(11) | NULL | YES | | NULL ....ces | comment for id汉字 |
| f1 | char(1) | latin1_swedish_ci | YES | | NULL ....ces | comment for f1汉字 |
+-------+---------+-------------------+------+-----+-------....----+--------------------+
2 rows in set (0.00 sec)

mysql> show table status like 't_iorikingdom';
+---------------+--------+---------+----------.....----+-----------------------+
| Name | Engine | Version | Row_forma.....ons | Comment |
+---------------+--------+---------+----------.....----+-----------------------+
| t_iorikingdom | InnoDB | 10 | Compact ..... | comment for table汉字 |
+---------------+--------+---------+----------.....----+-----------------------+
1 row in set (0.00 sec)

mysql>
ACMAIN_CHM 2009-07-13
  • 打赏
  • 举报
回复

mysql> show create table t_iorikingdom;
+---------------+---------------------------------------------------------------
| Table | Create Table
+---------------+---------------------------------------------------------------
| t_iorikingdom | CREATE TABLE `t_iorikingdom` (
`id` int(11) DEFAULT NULL COMMENT 'comment for id',
`f1` char(1) DEFAULT NULL COMMENT 'comment for f1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='comment for table' |
+---------------+---------------------------------------------------------------
1 row in set (0.00 sec)

mysql>
mysql> show full columns from t_iorikingdom;
+-------+---------+-------------------+------+-----+----....-----+----------------+
| Field | Type | Collation | Null | Key | Def.... | Comment |
+-------+---------+-------------------+------+-----+----....-----+----------------+
| id | int(11) | NULL | YES | | NUL....nces | comment for id |
| f1 | char(1) | latin1_swedish_ci | YES | | NUL....nces | comment for f1 |
+-------+---------+-------------------+------+-----+----....-----+----------------+
2 rows in set (0.00 sec)

mysql>
mysql> show table status like 't_iorikingdom';
+---------------+--------+---------+------....----------------+-------------------+
| Name | Engine | Version | Row_f.... Create_options | Comment |
+---------------+--------+---------+------....----------------+-------------------+
| t_iorikingdom | InnoDB | 10 | Compa.... | comment for table |
+---------------+--------+---------+------....----------------+-------------------+
1 row in set (0.00 sec)

mysql>


wwwwb 2009-07-13
  • 打赏
  • 举报
回复
MYSQL版本?
检查一下字符集设置
show variables like 'char%';
vinsonshen 2009-07-13
  • 打赏
  • 举报
回复
你查表的comment:
select table_comment from information_schema.tables;

查字段的:

select column_comment from information_schema.columns;
wwwwb 2009-07-13
  • 打赏
  • 举报
回复
什么现象?
WWWWA 2009-07-13
  • 打赏
  • 举报
回复
是MYSQL命令行?

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧