mysql 查询中索引的怪问题
SQL code:
explain select * from t_user where username like '%胖';
结果:
+----+-------------+--------+-------+---------------+------------+---------+------+------+-----------------------
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra
+----+-------------+--------+-------+---------------+------------+---------+------+------+-----------------------
| 1 | SIMPLE | t_user | index | NULL | ind_second | 62 | NULL | 5 | Using where; Using
index |
possible_keys 是可用的索引,key 是用到的索引
possible_keys 为null ,key 就不可能有值呀
这是哪里出问题了?
show index from t_user;
show create table t_user;
贴出来看一下。
结果分别是这样的:
CREATE TABLE `t_user` (
`userid` int(11) NOT NULL AUTO_INCREMENT,
`userName` varchar(20) NOT NULL,
PRIMARY KEY (`userid`),
KEY `ind_second` (`userName`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=
相关问答:
在安装Java编译器的Eclipse的时候,对环境变量进行了配置,在安装MySQl的时候也要对环境变量进行配置;那么后面的配置会影响前面的Eclipse的配置吗?
请大家多指教~!谢谢!
不会把,我这都装了的 我系统里 还装了 ......
我的Mysql 使用的时候 用dos建立的数据表 在dos中能显示出中文
但是在 其他的可视页面 和网页中都显示乱码 如何解决?
在mysql控制台:show variables like 'char%';贴结果出来看看。
mysql命令行模式下: ......
try
{
sql::Driver *driver;
sql::Connection *con;
//创建连接
driver = get_driver_instance();
con = driver->connect("tcp://192.168.18.52:3306", "root", "1234 ......