{"id":1836,"date":"2022-11-27T23:29:14","date_gmt":"2022-11-27T15:29:14","guid":{"rendered":"https:\/\/qaqaq.top\/?p=1836"},"modified":"2022-11-28T20:06:17","modified_gmt":"2022-11-28T12:06:17","slug":"%e5%91%bd%e4%bb%a4%e8%a1%8c%e9%aa%8c%e8%af%81mysql%e7%9a%84%e9%9a%94%e7%a6%bb%e7%ba%a7%e5%88%ab","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=1836","title":{"rendered":"\u547d\u4ee4\u884c\u9a8c\u8bc1MySQL\u7684\u9694\u79bb\u7ea7\u522b"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#JDBC \u547d\u4ee4\u884c\u9a8c\u8bc1MySQL\u7684\u9694\u79bb\u7ea7\u522b root\n\nCREATE USER tom IDENTIFIED BY '123456';\n\nSHOW DATABASES;\n\nGRANT SELECT,INSERT,UPDATE,DELETE ON test.* TO tom@'%';\n\nUSE test;\n\nSELECT * FROM user_table WHERE user = 'CC';\n\nSET AUTOCOMMIT = FALSE;\n\nSELECT @@transaction_isolation;\n\n#REPEATABLE-READ\nSELECT * FROM user_table WHERE user = 'CC'; #2000\n\nSELECT * FROM user_table WHERE user = 'CC'; #2000\n\nSELECT * FROM user_table WHERE user = 'CC'; #2000\n\nCOMMIT;\n\nSELECT * FROM user_table WHERE user = 'CC'; #3000\n\n\nSET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;\nSET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;\n\nSELECT @@transaction_isolation;\n\nSET AUTOCOMMIT = FALSE;\n\nUSE test;\n\n#READ-COMMITTED\nSELECT * FROM user_table WHERE user = 'CC'; #3000\n\nSELECT * FROM user_table WHERE user = 'CC'; #3000\n\nSELECT * FROM user_table WHERE user = 'CC'; #4000\n\nCOMMIT;\n\n\nSET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\nSET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\n\nSELECT @@transaction_isolation;\n\nSET AUTOCOMMIT = FALSE;\n\n#READ-UNCOMMITTED\nSELECT * FROM user_table WHERE user = 'CC'; #4000\n\nSELECT * FROM user_table WHERE user = 'CC'; #5000\n\nSELECT * FROM user_table WHERE user = 'CC'; #4000\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#JDBC \u547d\u4ee4\u884c\u9a8c\u8bc1MySQL\u7684\u9694\u79bb\u7ea7\u522b tom\n\nSHOW DATABASES;\n\nSHOW DATABASES;\n\nUSE test;\n\nSELECT * FROM user_table WHERE user = 'CC';\n\nSET AUTOCOMMIT = FALSE;\n\nSELECT @@transaction_isolation;\n\n#REPEATABLE-READ\nSELECT * FROM user_table WHERE user = 'CC'; #2000\n\nUPDATE user_table SET balance = 3000 WHERE user = 'CC';\n\nSELECT * FROM user_table WHERE user = 'CC'; #3000\n\nCOMMIT;\n\n\nSET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;\n\nSELECT @@transaction_isolation;\n\nSET AUTOCOMMIT = FALSE;\n\nUSE test;\n\n#READ-COMMITTED\nSELECT * FROM user_table WHERE user = 'CC'; #3000\n\nUPDATE user_table SET balance = 4000 WHERE user = 'CC';\n\nCOMMIT;\n\n\nSET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\n\nSELECT @@transaction_isolation;\n\nSET AUTOCOMMIT = FALSE;\n\n#READ-UNCOMMITTED\nSELECT * FROM user_table WHERE user = 'CC'; #4000\n\nUPDATE user_table SET balance = 5000 WHERE user = 'CC';\n\nROLLBACK;\n\nSELECT * FROM user_table WHERE user = 'CC'; #4000\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[48],"class_list":["post-1836","post","type-post","status-publish","format-standard","hentry","category-jdbc-code","tag-jdbc"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1836"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1836"}],"version-history":[{"count":2,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1836\/revisions"}],"predecessor-version":[{"id":1860,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1836\/revisions\/1860"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}