In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail about the need for commit in the MySQL database. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Whether mysql needs commit for operations such as insert depends on your storage engine. If it is an engine that does not support transactions, such as myisam, then commit is ineffective.
Recommended course: MySQL tutorial.
If it is an engine that supports transactions, such as innodb, you need to know whether your transaction supports auto-commit transactions (that is, commit)
To see whether your database is automatic commit, you can use mysql > show variables like'% autocommit%'; to view it. If it is OFF, it does not automatically commit, you need manual commit operation (the command line can directly "commit;" command), otherwise it is automatic commit.
There are three types of submission data: explicit submission, implicit submission, and automatic submission.
These three types are described below.
Explicit submission
A commit that is done directly with the COMMIT command is an explicit commit.
Implicit submission
A commit that is done indirectly with the SQL command is an implicit commit. These commands are:
ALTER, AUDIT, COMMENT, CONNECT, CREATE, DISCONNECT, DROP, EXIT, GRANT, NOAUDIT, QUIT, REVOKE, RENAME .
Automatic submission
If AUTOCOMMIT is set to ON, after the insert, modify and delete statements are executed
The system will submit automatically, which is called automatic submission. Its format is: SQL > SET AUTOCOMMIT ON
Be careful when using the COMMIT / ROLLBACK commands. COMMIT / ROLLBACK is used after the execution of DML statements (INSERT / DELETE / UPDATE / SELECT). After the DML statement is executed, the data processed will be placed in the rollback segment (except the SELECT statement), waiting for the user to submit (COMMIT) or ROLLBACK (rollback). When the user executes COMMIT / ROLLBACK, the data placed in the rollback segment will be deleted. (after the SELECT statement is executed, the data exists in the shared pool. When it is provided to others to query the same data, it is directly extracted in the shared pool, and there is no need to extract it from the database, which improves the speed of data query. )
All DML statements are explicitly committed, that is, the COMMIT is executed after the DML statement is executed. Others, such as DDL statements, are implicitly submitted. That is, after running those non-DML statements, the database has been implicitly committed, such as CREATE TABLE, after running the script, the table has been built, and you are no longer required to explicitly commit.
About the need for commit in the MySQL database to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.