mysql 트랜잭션(transaction)을 위해 이노디비(innodb)를 변경

mysql innodb엔진은 4.x부터는 mysql설치시 기본적으로 탑재되어 있었으나
5.1.3x부터는 기존 configure 옵션되로 하면 기본적으로 innodb가 탑재가 안되며
configure옵션에 –with-plugins=innobase 또는 –with-plugins=max 옵션을 추가해줘야 한다.

innodb부분이 YES로 나와있어야함.
mysql> show variables like ‘have_innodb’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| have_innodb   | YES   |
+—————+——-+
1 row in set (0.00 sec)
myisam에서 innodb로 변경
ALTER TABLE 테이블명 ENGINE=INNODB
ALTER TABLE 테이블명 TYPE=INNODB
innodb테이블생성시
create table a(a int not null, b int) engine=innodb    (engine=inodb옵션이 붙어야함)
트랜잭션 사용start transaction;
insert into test1 values (11);
insert into test2 values (21);
commit;
#MYSQL #innodb #Transaction #트랜잭션 #이노디비

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny