mysql 的isam引擎不支持int字段递减

    技术2022-07-10  93

    mysql> create table use1 ( userid int(10) not null unique primary key auto_increment, username varchar(10) not null, passwd varchar(20) not null, info text, unique index index_uid(userid desc), index index_user (username,passwd), fulltext index index_info(info))engine = myisam; ERROR 1178 (42000): The storage engine for the table doesn't support descending indexes

    解决方法,换成innodb引擎后就可以使用了。

     

    mysql> create table use4 (    userid int(10) not null unique primary key auto_increment,   username varchar(10) not null,    passwd varchar(20) not null, info text,   unique index index_uid(userid desc),   index index_user (username,passwd),   fulltext index index_info(info))engine = innodb; Query OK, 0 rows affected, 1 warning (0.20 sec)

     

    Processed: 0.151, SQL: 9