您好InnoDB有一个支持交易的默认数据库。 但是当我为Mysql sql-benchmarking运行事务脚本时,我得到以下错误:
Testing server 'MySQL 5.5.29 0ubuntu0.12.10.1' at 2013-02-11 11:32:28
Test skipped because the database doesn't support transactions
显示引擎;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
我已经编辑了my.cnf添加默认引擎Innodb。但仍然没有运气。
perl脚本是Mysql Sql bench中的“test-transaction”...
###
### Test insert perfomance
###
test_insert("bench1","insert_commit",0);
test_insert("bench2","insert_autocommit",1);
sub test_insert
{
my ($table, $test_name, $auto_commit)= @_;
my ($loop_time,$end_time,$id,$rev_id,$grp,$region);
$dbh->{AutoCommit}= $auto_commit;
$loop_time=new Benchmark;
for ($id=0,$rev_id=$opt_loop_count-1 ; $id < $opt_loop_count ;
$id++,$rev_id--)
{
$grp=$id/$opt_groups;
$region=chr(65+$id%$opt_groups);
do_query($dbh,"insert into $table values ($id,$rev_id,'$region',$grp,0)");
}
$dbh->commit if (!$auto_commit);
$end_time=new Benchmark;
print "Time for $test_name ($opt_loop_count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n\n";
}