Can I perform a transaction across two MySQL databases?

前端 未结 1 1032
感动是毒
感动是毒 2021-02-12 21:41

Can I do?

Start transaction;

insert into db1.table1 (field1) values (100),(100);

insert into db2.table2 (field2) values (100),(100);

commit;

相关标签:
1条回答
  • 2021-02-12 21:50

    Yes you can:

    MySQL 5.0.3 and up provides server-side support for XA transactions. Currently, this support is available for the InnoDB storage engine. The MySQL XA implementation is based on the X/Open CAE document Distributed Transaction Processing: The XA Specification. This document is published by The Open Group and available at
    http://www.opengroup.org/public/pubs/catalog/c193.htm. Ref: XA Transactions

    0 讨论(0)
提交回复
热议问题