160229 19:48:06 InnoDB: MySQL and InnoDB data dictionaries are out of sync.
InnoDB: Unable to find the AUTOINC column id in the InnoDB table zysupermarket/cart.
InnoDB: We set the next AUTOINC column value to 0,
InnoDB: in effect disabling the AUTOINC next value generation.
InnoDB: You can either set the next AUTOINC value explicitly using ALTER TABLE
InnoDB: Unable to find the AUTOINC column id in the InnoDB table zysupermarket/cart.
InnoDB: We set the next AUTOINC column value to 0,
InnoDB: in effect disabling the AUTOINC next value generation.
InnoDB: You can either set the next AUTOINC value explicitly using ALTER TABLE
InnoDB: or fix the data dictionary by recreating the table.
这两天弄了个小程序,其中需要建数据库表,数据库用的事mysql 5.1.51
用了个管理软件 Mysql-front 5.3
建表的时候使用的id为 auto_increment
由于是使用管理软件自动建表导致id命名时被命名成Id,前端查询的时候还用id去查结果查不到,就手贱把数据库Id改成id了。
开始并没什么问题,可是电脑晚上关机,第二天再用的时候管理软件打不开。开始还以为是软件问题各种卸载重装,而且mysql自带dos管理客户端可以连接,
但是发现还是没用,索性删掉表格重建,问题解决。
谁知第二次又是上述情况,于是各种百度,网上都说是innodb_open_files 过大导致,
查了一下我的才300远远不到。后来索性又删除表格重建,问题又解决了,原来每次问题都发生在数据库服务停止又启动后,打开数据库管理软件时。
最后发现是由于我建表后更改了id列的名称导致的问题,具体原理尚不清楚,但是此处记录以免再犯。。。。。