mysql是否支持事务和锁? 可以,用 InnoDb的表类型就可以了; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试过了,好像不行,不能rollback在my.ini中:Server=C:/mysql/bin/mysqld-max.exedefault-table-type=innodb另外设置set autocommit=0;begin后用rollback显示错误:ERROR 1196: Warning: Some non-transactional changed tables couldn't be rolled back请问具体应该怎么设置,谢谢大家,谢谢楼主:) 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> 两个人同时更新一条记录会不会出问题:version:4.0.17 过程出错帮个忙 急求解order by时的问题??? 求一mysql语句,题目如下:(补充昨天的) 插入数据时,重复数据只插入一次 为什么我的mysql表记录数一超过400万就会有奇怪的问题 mysql中使用exists,出错,达人帮看一下 下载MyODBC后,配置数据源出现这样的错误,请大家看看 关于MySQL用户登陆和创建数据库的问题!! mysql局域网连接问题 关于mysql视图的一个问题 从远程链接MYSQL数据库速度慢 删除数据库里table.I_ndex值最小的100条数据?这样的sql语句怎样写???
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请问具体应该怎么设置,谢谢大家,谢谢楼主:)
-> 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>