{"id":8260,"date":"2023-01-18T04:41:06","date_gmt":"2023-01-17T20:41:06","guid":{"rendered":"https:\/\/www.ek21.com\/dating\/8260\/"},"modified":"2023-01-18T04:41:06","modified_gmt":"2023-01-17T20:41:06","slug":"mysql%e8%a1%a8%e9%8e%96%e3%80%81%e8%a1%8c%e9%8e%96%e3%80%81%e7%b4%a2%e5%bc%95%e4%b9%8b%e9%96%93%e6%9b%96%e6%98%a7%e7%9a%84%e9%97%9c%e4%bf%82","status":"publish","type":"post","link":"https:\/\/ek21.com\/dating\/8260\/","title":{"rendered":"mysql\u8868\u9396\u3001\u884c\u9396\u3001\u7d22\u5f15\u4e4b\u9593\u66d6\u6627\u7684\u95dc\u4fc2"},"content":{"rendered":"<p>MySQL\u7684innodb\u5b58\u5132\u5f15\u64ce\u652f\u6301\u884c\u7d1a\u9396\uff0cinnodb\u7684\u884c\u9396\u662f\u901a\u904e\u7d66\u7d22\u5f15\u9805\u52a0\u9396\u505a\u5230\u7684\uff0c\u9019\u5c31\u610f\u5473\u8457\u53ea\u6709\u901a\u904e\u7d22\u5f15\u689d\u4ef6\u6aa2\u7d22\u6578\u64da\u6642\uff0cinnodb\u624d\u4f7f\u7528\u884c\u9396\uff0c\u5426\u5247\u4f7f\u7528\u8868\u9396\u3002<\/p>\n<p>\u6839\u64da\u7576\u524d\u7684\u6578\u64da\u66f4\u65b0\u8a9e\u53e5\uff08UPDATE user set name=&#8217;11111&#8242; where account=&#8217;1&#8217;\uff09\uff0c\u8a72\u689d\u4ef6\u5b57\u6bb5account\u4e26\u6c92\u6709\u6dfb\u52a0\u7d22\u5f15\uff0c\u6240\u4ee5\u5c0e\u81f4\u6578\u64da\u8868\u88ab\u9396\u3002<\/p>\n<p>\u6211\u5011\u9a57\u8b49\u4e00\u4e0b\uff1a<\/p>\n<p>\u7b2c\u4e00\u7a2e\u60c5\u6cc1\uff0c\u901a\u904e\u975e\u7d22\u5f15\u689d\u4ef6\u6aa2\u7d22\u6578\u64da\u6642\uff0c\u4f7f\u7528\u7684\u662f\u8868\u9396\uff0c\u6703\u5c0e\u81f4\u6578\u64da\u8868\u88ab\u9396<\/p>\n<p>1.\u9996\u5148\uff0c\u6211\u5011\u5c07mysql\u4e8b\u52d9\u8a2d\u7f6e\u70ba\u4e0d\u81ea\u52d5\u63d0\u4ea4\uff0cmysql\u4e8b\u52d9\u9ed8\u8a8d\u662f\u81ea\u52d5\u63d0\u4ea4\u4e8b\u52d9\u7684\uff0c1\u8868\u793a\u81ea\u52d5\u63d0\u4ea4\u4e8b\u52d9<\/p>\n<pre>mysql&gt; select @@autocommit;\n+--------------+\n| @@autocommit |\n+--------------+\n| 1 |\n+--------------+\n1 row in set\n<\/pre>\n<pre>mysql&gt; set autocommit = 0\n;\nQuery OK, 0 rows affected\n<\/pre>\n<p>2.\u8d77\u4e00\u500b\u547d\u4ee4\u884c\uff0c\u958b\u59cb\u4e8b\u52d9\uff0c\u66f4\u65b0\u7b2c\u4e00\u689d\u8a18\u9304\uff0c\u5148\u4e0d\u63d0\u4ea4<\/p>\n<pre>mysql&gt; start transaction;\nQuery OK, 0 rows affected\nmysql&gt; beg\nin;\nQuery OK, 0 rows affected\nmysql&gt; UPDATE user set name='11111' where account='1'\n -&gt; \n<\/pre>\n<p>3.\u6211\u5011\u518d\u8d77\u4e00\u500b\u547d\u4ee4\u884c\uff0c\u66f4\u65b0\u7b2c\u4e8c\u689d\u8a18\u9304<\/p>\n<pre>UPDATE user set name='2222' where id='2'\n<\/pre>\n<p>4.\u770b\u4e0b\u8868\u7684\u6578\u64da<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/p99.pstatp.com\/large\/pgc-image\/1541085258841e010905a2c?\/1.jpg\" alt=\"mysql\u8868\u9396\u3001\u884c\u9396\u3001\u7d22\u5f15\u4e4b\u9593\u66d6\u6627\u7684\u95dc\u4fc2\"><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u6578\u64da\u8868\u6c92\u6709\u66f4\u65b0<\/p>\n<p>5.\u628a\u7b2c\u4e00\u500b\u547d\u4ee4\u884c\u7684\u4e8b\u52d9\u63d0\u4ea4\u4e86<\/p>\n<pre>mysql&gt; commit;\nQuery OK, 0 rows affected\n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/p1.pstatp.com\/large\/pgc-image\/1541085258981b0dc36d530?\/1.jpg\" alt=\"mysql\u8868\u9396\u3001\u884c\u9396\u3001\u7d22\u5f15\u4e4b\u9593\u66d6\u6627\u7684\u95dc\u4fc2\"><\/p>\n<p>\u6211\u5011\u770b\u5230\u73fe\u5728\u6578\u64da\u66f4\u65b0\u4e86\u3002<\/p>\n<p>\u7b2c\u4e8c\u7a2e\u60c5\u6cc1\uff0c\u901a\u904e\u7d22\u5f15\u689d\u4ef6\u6aa2\u7d22\u6578\u64da\u6642\uff0c\u4f7f\u7528\u7684\u662f\u884c\u9396<\/p>\n<p>\u5982\u7b2c\u4e00\u7a2e\u60c5\u6cc1\uff0c\u81ea\u5df1\u6e2c\u8a66\u4e0b\u3002<\/p>\n<p class=\"p1\" style=\"text-align: center;\"><a style=\"text-size-adjust: 100%; padding: 15px 18px 18px; valign=top; border-radius: 10px; background-color: #3b5998;\" href=\"https:\/\/eros.ek21.com\/user\/fb_login\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #ffffff;\"><span style=\"font-family: PingFang TC; font-size: medium;\"><span style=\"letter-spacing: normal;\">\u4f7f\u7528 Facebook \u9810\u7d04<\/span><\/span><\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>MySQL\u7684innodb\u5b58\u5132\u5f15\u64ce\u652f\u6301\u884c\u7d1a\u9396\uff0cinn <a class=\"mh-excerpt-more\" href=\"https:\/\/ek21.com\/dating\/8260\/\" title=\"mysql\u8868\u9396\u3001\u884c\u9396\u3001\u7d22\u5f15\u4e4b\u9593\u66d6\u6627\u7684\u95dc\u4fc2\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[26,43],"class_list":["post-8260","post","type-post","status-publish","format-standard","hentry","category-hit","tag-26","tag-43"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/posts\/8260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/comments?post=8260"}],"version-history":[{"count":0,"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/posts\/8260\/revisions"}],"wp:attachment":[{"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/media?parent=8260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/categories?post=8260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ek21.com\/dating\/wp-json\/wp\/v2\/tags?post=8260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}