- 博客(3)
- 收藏
- 关注
原创 mysql查询最大值max()对应的记录值。
群里有人问。。开始以为 max() ,然后分组就可以。。结果试确实不行。。正确方式如下:select myid,price,other from test as t where price=(select max(t1.price) from test as t1 where t
2016-04-21 16:02:34 54368 4
原创 drop表提示Waiting for table metadata lock 解决
引起这个原因的应该是应用程序的异常处理没有rollback。解决办法: select concat("kill ",trx_mysql_thread_id,";") as kill_id from information_schema.INNODB_TRX where trx_lock_structs=0 and trx_weight=0 and trx_rows_loc
2016-04-21 13:18:39 3417
转载 innodb_flush_log_at_trx_commit理解!
当设置该值为1时,每次事务提交都要做一次fsync,这是最安全的配置,即使宕机也不会丢失事务;当设置为2时,则在事务提交时只做write操作,只保证写到系统的page cache,因此实例crash不会丢失事务,但宕机则可能丢失事务;当设置为0时,事务提交不会触发redo写操作,而是留给后台线程每秒一次的刷盘操作,因此实例crash将最多丢失1秒钟内的事务。
2016-04-21 10:08:32 1775 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人