前提:本人部署了一个java web工程连接本地的MySQL。当时java web在执行sql insert语句时会导致MySQL down掉。
现象:为了查明down掉原因,我通过debug执行java web工程的代码,当执行完以下语句
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
后,
通过MySQL Query Broswer执行select查询某些表时,会发生Unknown MySQL error ErrorNr.2000。
通过MySQL Query Broswer执行insert语句时,会发生Lost Connection to MySQL server during query ErrorNr.2000。这时候MySQL服务已经down掉了。
再次启动MySQL服务时,会产生下面的日志:
InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
140701 14:47:01  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 4553308.
InnoDB: Doing recovery: scanned up to log sequence number 0 4553308
InnoDB: 1 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 1 row operations to undo
InnoDB: Trx id counter is 0 26624
InnoDB: Last MySQL binlog file position 0 0, file name 
InnoDB: Starting in background the rollback of uncommitted transactions
140701 14:47:01  InnoDB: Rolling back trx with id 0 26238, 1 rows to undo
140701 14:47:01  InnoDB: Started; log sequence number 0 4553308InnoDB: Rolling back of trx id 0 26238 completed
140701 14:47:01  InnoDB: Rollback of non-prepared transactions completed
140701 14:47:01 [Note] F:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
Version: '5.0.16-nt-log'  socket: ''  port: 3306  Official MySQL binary现在就是不知道是什么问题,该怎么解决。大家帮忙找找原因啊!!!
个人认为不是代码原因,是本机的mysql有问题。
因为本机上同样的代码连接其他机器的db是好的;而连接本机的db才会发生上面的问题。其他机器和本机的db都是同一个的sql脚本导入的,所以db内容应该是一样的。
别人机器的代码连接我的db也会把我的db搞down掉。