可以,用 InnoDb的表类型就可以了;

解决方案 »

  1.   

    试过了,好像不行,不能rollback在my.ini中:
    Server=C:/mysql/bin/mysqld-max.exe
    default-table-type=innodb另外设置
    set autocommit=0;
    begin后用rollback显示错误:
    ERROR 1196: Warning:  Some non-transactional changed tables couldn't be rolled back请问具体应该怎么设置,谢谢大家,谢谢楼主:)
      

  2.   

    mysql> CREATE TABLE tmp (
        ->   id int(10) unsigned NOT NULL auto_increment,
        ->   name varchar(20) NOT NULL default '',
        ->   age tinyint(3) unsigned default '0',
        ->   sex tinyint(3) unsigned default '0',
        ->   PRIMARY KEY  (id)
        -> ) TYPE=InnoDb;
    Query OK, 0 rows affected (0.09 sec)mysql> select * from tmp;
    Empty set (0.00 sec)mysql> begin;
    Query OK, 0 rows affected (0.00 sec)mysql> insert into tmp(name) values('coolwind');
    Query OK, 1 row affected (0.01 sec)mysql> insert into tmp(name) values('coolwind');
    Query OK, 1 row affected (0.00 sec)mysql> select * from tmp;
    +----+----------+------+------+
    | id | name     | age  | sex  |
    +----+----------+------+------+
    |  1 | coolwind |    0 |    0 |
    |  2 | coolwind |    0 |    0 |
    +----+----------+------+------+
    2 rows in set (0.00 sec)mysql> commit;
    Query OK, 0 rows affected (0.02 sec)mysql> select * from tmp;
    +----+----------+------+------+
    | id | name     | age  | sex  |
    +----+----------+------+------+
    |  1 | coolwind |    0 |    0 |
    |  2 | coolwind |    0 |    0 |
    +----+----------+------+------+
    2 rows in set (0.00 sec)mysql> begin;
    Query OK, 0 rows affected (0.00 sec)mysql> insert into tmp(name) values('xixihaha');
    Query OK, 1 row affected (0.00 sec)mysql> insert into tmp(name) values('xixihaha');
    Query OK, 1 row affected (0.00 sec)mysql> select * from tmp;
    +----+----------+------+------+
    | id | name     | age  | sex  |
    +----+----------+------+------+
    |  1 | coolwind |    0 |    0 |
    |  2 | coolwind |    0 |    0 |
    |  3 | xixihaha |    0 |    0 |
    |  4 | xixihaha |    0 |    0 |
    +----+----------+------+------+
    4 rows in set (0.00 sec)mysql> rollback;
    Query OK, 0 rows affected (0.05 sec)mysql> select * from tmp;
    +----+----------+------+------+
    | id | name     | age  | sex  |
    +----+----------+------+------+
    |  1 | coolwind |    0 |    0 |
    |  2 | coolwind |    0 |    0 |
    +----+----------+------+------+
    2 rows in set (0.00 sec)mysql>
      

  3.   

    两个人同时更新一条记录会不会出问题:version:4.0.17