The mysql5.6 + myisam table cannot be processed in the transaction and an error is returned. Solution

Source: Internet
Author: User
I think what I have already said is very clear. It is difficult to look at the original text. The Chinese are the replies taught by computer teachers, and I cannot reply them one by one. Of course, I know that myisam tables do not support transactions. I just want to use this to implement table logs in transactions! Please read the question carefully !!! Mysql5... I think I have already made it very clear. It is not good to see the original articles. The Chinese are the replies taught by computer teachers. I really cannot reply them one by one. Of course, I know that myisam tables do not support transactions. I just want to use this to implement table logs in transactions! Please read the question carefully !!!

After mysql 5.6Transaction ProcessAnd cannot operate tables of the myisam type.
If the following error is reported:

General error: 1785 When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.

As the business logic requires, some raw data must be saved in a large transaction. And if the transaction rollback, the data still needs to be saved. Therefore, myisam tables can be used before, and an error is reported decisively.

Last saved CachecommitI have already considered the Save scheme... too many changes will be involved.
I just want to ask if you have any better solutions...

I mean, with the help of the features that myisam does not support transactions, you can save the data in the transaction without worrying about the problem that the data cannot be saved after the transaction rollback, the new version of mysql cannot be operated like this, and an exception occurs.

Reply content: I think I have already made it very clear that the original text is not good-looking and the language is the reply recipients taught by the computer teacher. I really cannot reply one by one. Of course, I know that myisam tables do not support transactions. I just want to use this to implement table logs in transactions! Please read the question carefully !!!

After mysql 5.6Transaction ProcessAnd cannot operate tables of the myisam type.
If the following error is reported:

General error: 1785 When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.

As the business logic requires, some raw data must be saved in a large transaction. And if the transaction rollback, the data still needs to be saved. Therefore, myisam tables can be used before, and an error is reported decisively.

Last saved CachecommitI have already considered the Save scheme... too many changes will be involved.
I just want to ask if you have any better solutions...

I mean, with the help of the features that myisam does not support transactions, you can save the data in the transaction without worrying about the problem that the data cannot be saved after the transaction rollback, the new version of mysql cannot be operated like this, and an exception occurs.

According to the error message, the mysql parameter @ GLOBAL. ENFORCE_GTID_CONSISTENCY = 1, so myisam cannot be used in the transaction. The transaction is about mysql and has nothing to do with php!

I don't know if it's just me --#
The two answers are all about parameter execution, but myisam does not support things at all.

Mysql only supports transactions in innodb tables.

Innodb can support transaction operations. The landlord's database is better than me !!!

When I upgraded the mysql database from 5.5 to 5.6, I encountered this error because the associated database tables use transactions, but some associated tables use myisam to change myiasm TO THE innnodb engine. now

To write the transaction function, you must first understand the transaction. innodb supports transactions, but myisam does not.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.