MySQL does not support transaction processing workaround

Source: Internet
Author: User
Tags phpmyadmin

MySQL does not support transaction processing workaround

July 07, 2014 23:20 Encyclopedia 369

MySQL does not support transaction processing workaround

The default storage engine type for MySQL database is MyISAM, which does not support transactional processing.

In MySQL, only data tables with the InnoDB storage engine type can support transactions.

Therefore, if you want MySQL to support transactional processing, simply modify the data table to the InnoDB storage engine type. The procedure is as follows:

1. Go to the phpMyAdmin main interface and in the navigation panel select the database you want to convert to the InnoDB storage engine type, for example, select the Db_xuesheng database. As shown in the following:

2. At the top of the main screen, click on the "SQL" hyperlink to open the "Run SQL query in Database Db_xuesheng" window. As shown in the following:

3. In the window, enter

Show engines;

SQL command.

4. Click the "Execute" button in the bottom right corner of the window to open the "Show Query Box" page. As shown in the following:

5. On the Show Query box page, we find that the transactions entry for the InnoDB type is yes, which means that the InnoDB type of database or data table supports transactional processing.

Below, we can support transaction operations simply by modifying the related data table to the InnoDB storage engine type.

6. In the phpMyAdmin navigation panel, select the database Db_xuesheng to modify the storage engine type, and then click the SQL hyperlink at the top of the main interface to open the run SQL query in Database Db_xuesheng window. As shown in the following:

7. In the Query window, enter

ALTER TABLE Tb_chengji ENGINE = InnoDB;

SQL command.

If you enter

ALTER TABLE ' Tb_chengji ' ENGINE = InnoDB;

SQL commands are also OK.

' Tb_chengji ' on both sides of the symbol is in English input case, press the key to hit out:

8. Click the "Execute" button in the lower right corner to open the "SQL" hyperlink window. As shown in the following:

9. At this point, the data table has been successfully converted from the MyISAM storage engine type to the InnoDB storage engine type.

We can also perform transactional operations in the data table!

Related Article

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.