当前位置:网站首页>Commit and ROLLBACK in DCL of 16mysql
Commit and ROLLBACK in DCL of 16mysql
2022-04-23 20:17:00 【GH - Xiaohe】
Catalogue des articles
Auteur: gh-xiaohe
gh-xiaoheBlog de
Je pense que l'article du blogueur est bien écrit,J'espère que tout le monde sera trois(Attention,- Oui.,Commentaires),Plus de soutien!!
DCL Moyenne COMMITEtROllBACK
DCL Moyenne COMMITEtROllBACK
COMMIT
COMMIT:Présentation des données.Une fois mis en œuvreCOMMIT,Les données sont stockées en permanence dans la base de données,Cela signifie que les données ne peuvent pas être retournées en arrière.
ROLLBACK
ROLLBACK:Données de rollback.Une fois mis en œuvreROLLBACK,Le retour en arrière des données peut être réalisé.Retour au dernierCOMMITAprès.
Comparer
- Même chose.:Vous pouvez supprimer toutes les données du tableau,Conserver la structure du tableau.
- C'est différent.:
- TRUNCATE TABLE:Une fois cette opération effectuée,Effacer toutes les données du tableau.En même temps,Les données ne peuvent pas être retournées.
- DELETE FROM:Une fois cette opération effectuée,Les données du tableau peuvent être effacées complètement(SansWHERE).En même temps,Les données peuvent être retournées.
DDL Et DML Notes
① DDLFonctionnementUne fois mis en œuvre,JustePas de retour en arrière.DirectivesSET autocommit = FALSEC'est exact.DDLDéfaillance opérationnelle.(Parce qu'après l'exécutionDDLAprès l'opération,C'est sûr.Sera exécuté une foisCOMMIT.Et ceciCOMMITFonctionnement non soumis àSET autocommit = FALSEImpact.)
② DMLOpération par défaut pour,Une fois mis en œuvre,C'est aussiNon - ROLLBACK.Mais,SiEn coursDMLAvant,Mise en œuvre SET autocommit = FALSE,Pour exécuterDMLL'opération permet un retour en arrière.
CAS
COMMIT、DELETE
# Présentation:DELETE FROM #1) COMMIT; #2) SELECT * FROM myemp3; #3) SET autocommit = FALSE; #4) DELETE FROM myemp3; #5) SELECT * FROM myemp3; #6) ROLLBACK; #7) SELECT * FROM myemp3;
COMMIT、 ROLLBACK
# Présentation:TRUNCATE TABLE #1) COMMIT; #2) SELECT * FROM myemp3; #3) SET autocommit = FALSE; #4) TRUNCATE TABLE myemp3; #5) SELECT * FROM myemp3; #6) ROLLBACK; #7) SELECT * FROM myemp3;
MySQL8.0Nouvelles caractéristiques de:DDLAtomisation de
InMySQL 8.0Dans la version,InnoDBLe tableauDDLSoutenir l'intégrité des transactions,C'est - à - dire:DDLL'opération est réussie ou inversée.DDLAction ROLLBACK log write todata dictionaryTable du dictionnaire de donnéesmysql.innodb_ddl_log(Cette table est cachée,Adoptionshow tablesImpossible de voir)Moyenne,Pour l'opération ROLLBACK.En définissant les paramètres,Peut êtreDDLImprimer le Journal des opérations àMySQLDans le Journal des erreurs.
Séparément dansMySQL 5.7Version etMySQL 8.0Créer des bases de données et des tableaux de données dans la version,Les résultats sont les suivants::
CREATE DATABASE mytest; # Créer une base de données mytest USE mytest; # Passer à mytest Sous la base de données CREATE TABLE book1( # Création book1 Tableau book_id INT , book_name VARCHAR(255) ); SHOW TABLES; # Voir le tableau sous les données actuelles
(1)InMySQL 5.7Dans la version,La procédure d'essai est la suivante::
# In mysql5.7 En bas. DROP TABLE book1,book2; # Supprimer la base de données maintenant book1 Et book2 Notez qu'il n'y a pas de book2 SHOW TABLES;
(2)InMySQL 8.0Dans la version,La procédure d'essai est la suivante::
# In mysql8.0 En bas. DROP TABLE book1,book2; # Supprimer la base de données maintenant book1 Et book2 Notez qu'il n'y a pas de book2 SHOW TABLES;
版权声明
本文为[GH - Xiaohe]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232017307463.html
边栏推荐
- DNS cloud school rising posture! Three advanced uses of authoritative DNS
- Confusion about thread blocking after calling the read () method of wrapper flow
- How about CICC fortune? Is it safe to open an account
- SQL Server connectors by thread pool 𞓜 instructions for dtsqlservertp plug-in
- What is the difference between a host and a server?
- VeraCrypt文件硬盘加密使用教程
- Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration
- Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
- JDBC database addition, deletion, query and modification tool class
- PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
猜你喜欢
Click an EL checkbox to select all questions
selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
Leetcode XOR operation
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(八)
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码
Grafana shares links with variable parameters
CVPR 2022 | querydet: use cascaded sparse query to accelerate small target detection under high resolution
LeetCode动态规划训练营(1~5天)
Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
An error is reported when sqoop imports data from Mysql to HDFS: sqlexception in nextkeyvalue
随机推荐
Building googlenet neural network based on pytorch for flower recognition
nc基础用法2
Rédaction de thèses 19: différences entre les thèses de conférence et les thèses périodiques
Operation of numpy array
Unity general steps for creating a hyper realistic 3D scene
Remote code execution in Win 11 using wpad / PAC and JScript
使用 WPAD/PAC 和 JScript在win11中进行远程代码执行1
还在用 ListView?使用 AnimatedList 让列表元素动起来
An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
Introduction to electron Tutorial 4 - switching application topics
After route link navigation, the sub page does not display the navigation style problem
論文寫作 19: 會議論文與期刊論文的區別
Servlet learning notes
Livego + ffmpeg + RTMP + flvjs to realize live video
MySQL advanced lock - overview of MySQL locks and classification of MySQL locks: global lock (data backup), table level lock (table shared read lock, table exclusive write lock, metadata lock and inte
考研英语唐叔的语法课笔记
Numpy - creation of data type and array
Markdown < a > tag new page open link
Understanding various team patterns in scrum patterns
The R language uses the timeroc package to calculate the multi time AUC value of survival data without competitive risk, and uses the confint function to calculate the confidence interval value of mul