{"id":158987,"date":"2024-11-03T10:33:15","date_gmt":"2024-11-03T02:33:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/158987\/"},"modified":"2024-11-03T10:33:16","modified_gmt":"2024-11-03T02:33:16","slug":"%e7%b4%85%e5%ad%a9%e5%ad%90%e5%ae%a2%e6%88%b7%e7%ab%af%e5%be%8c%e5%8f%b0%e6%95%b8%e6%93%9a%e5%ba%ab%e7%ae%a1%e7%90%86%e8%88%87%e4%bd%bf%e7%94%a8-%e7%b4%85%e5%ad%a9%e5%ad%90%e5%ae%a2%e6%88%b7%e7%ab%af","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/158987\/","title":{"rendered":"\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u5f8c\u53f0\u6578\u64da\u5eab\u7ba1\u7406\u8207\u4f7f\u7528 (\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef \u5f8c\u53f0\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"%e7%b4%85%e5%ad%a9%e5%ad%90%e5%ae%a2%e6%88%b7%e7%ab%af%e5%be%8c%e5%8f%b0%e6%95%b8%e6%93%9a%e5%ba%ab%e7%ae%a1%e7%90%86%e8%88%87%e4%bd%bf%e7%94%a8-yvtvULdElC\">\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u5f8c\u53f0\u6578\u64da\u5eab\u7ba1\u7406\u8207\u4f7f\u7528<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u5b57\u5316\u7684\u6642\u4ee3\uff0c\u6578\u64da\u5eab\u7ba1\u7406\u5c0d\u65bc\u4efb\u4f55\u4e00\u500b\u61c9\u7528\u7a0b\u5e8f\u7684\u6210\u529f\u904b\u884c\u81f3\u95dc\u91cd\u8981\u3002\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u4f5c\u70ba\u4e00\u500b\u6d41\u884c\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u5176\u5f8c\u53f0\u6578\u64da\u5eab\u7684\u7ba1\u7406\u8207\u4f7f\u7528\u66f4\u662f\u5f71\u97ff\u5230\u6574\u9ad4\u6027\u80fd\u548c\u7528\u6236\u9ad4\u9a57\u7684\u95dc\u9375\u56e0\u7d20\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u7684\u5f8c\u53f0\u6578\u64da\u5eab\u7ba1\u7406\u53ca\u5176\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<h2 id=\"%e5%be%8c%e5%8f%b0%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%9e%b6%e6%a7%8b-yvtvULdElC\">\u5f8c\u53f0\u6578\u64da\u5eab\u7684\u67b6\u69cb<\/h2>\n<p>\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u7684\u5f8c\u53f0\u6578\u64da\u5eab\u901a\u5e38\u63a1\u7528\u95dc\u4fc2\u578b\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff08RDBMS\uff09\uff0c\u5982MySQL\u6216PostgreSQL\u3002\u9019\u4e9b\u6578\u64da\u5eab\u7cfb\u7d71\u63d0\u4f9b\u4e86\u5f37\u5927\u7684\u6578\u64da\u5b58\u5132\u3001\u6aa2\u7d22\u548c\u7ba1\u7406\u529f\u80fd\uff0c\u80fd\u5920\u652f\u6301\u9ad8\u4e26\u767c\u7684\u7528\u6236\u8acb\u6c42\u3002<\/p>\n<ul>\n<li><strong>\u6578\u64da\u8868\u8a2d\u8a08\uff1a<\/strong>\u6578\u64da\u8868\u662f\u6578\u64da\u5eab\u7684\u57fa\u672c\u7d44\u6210\u90e8\u5206\uff0c\u5408\u7406\u7684\u6578\u64da\u8868\u8a2d\u8a08\u80fd\u5920\u63d0\u9ad8\u6578\u64da\u7684\u5b58\u53d6\u6548\u7387\u3002\u4f8b\u5982\uff0c\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u53ef\u80fd\u6703\u6709\u7528\u6236\u8868\u3001\u8a02\u55ae\u8868\u548c\u5546\u54c1\u8868\u7b49\u3002<\/li>\n<li><strong>\u7d22\u5f15\u7684\u4f7f\u7528\uff1a<\/strong>\u70ba\u4e86\u52a0\u5feb\u67e5\u8a62\u901f\u5ea6\uff0c\u61c9\u5728\u7d93\u5e38\u67e5\u8a62\u7684\u5b57\u6bb5\u4e0a\u5efa\u7acb\u7d22\u5f15\u3002\u9019\u6a23\u53ef\u4ee5\u986f\u8457\u63d0\u9ad8\u6578\u64da\u6aa2\u7d22\u7684\u6548\u7387\u3002<\/li>\n<li><strong>\u6578\u64da\u5b8c\u6574\u6027\uff1a<\/strong>\u4f7f\u7528\u5916\u9375\u7d04\u675f\u4f86\u7dad\u8b77\u6578\u64da\u4e4b\u9593\u7684\u95dc\u806f\u6027\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e7%ae%a1%e7%90%86%e5%b7%a5%e5%85%b7-yvtvULdElC\">\u6578\u64da\u5eab\u7684\u7ba1\u7406\u5de5\u5177<\/h2>\n<p>\u70ba\u4e86\u6709\u6548\u5730\u7ba1\u7406\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u7684\u5f8c\u53f0\u6578\u64da\u5eab\uff0c\u958b\u767c\u8005\u548c\u7ba1\u7406\u54e1\u53ef\u4ee5\u4f7f\u7528\u591a\u7a2e\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u5177\uff1a<\/p>\n<ul>\n<li><strong>phpMyAdmin\uff1a<\/strong>\u9019\u662f\u4e00\u500b\u57fa\u65bcWeb\u7684MySQL\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u76f4\u89c0\u7684\u7528\u6236\u754c\u9762\uff0c\u65b9\u4fbf\u7528\u6236\u9032\u884c\u6578\u64da\u5eab\u7684\u7ba1\u7406\u548c\u64cd\u4f5c\u3002<\/li>\n<li><strong>Navicat\uff1a<\/strong>\u9019\u662f\u4e00\u6b3e\u529f\u80fd\u5f37\u5927\u7684\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u5177\uff0c\u652f\u6301\u591a\u7a2e\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u63d0\u4f9b\u4e86\u6578\u64da\u5efa\u6a21\u3001\u67e5\u8a62\u7de8\u8f2f\u548c\u5831\u544a\u751f\u6210\u7b49\u529f\u80fd\u3002<\/li>\n<li><strong>MySQL Workbench\uff1a<\/strong>\u9019\u662fMySQL\u5b98\u65b9\u63d0\u4f9b\u7684\u6578\u64da\u5eab\u8a2d\u8a08\u548c\u7ba1\u7406\u5de5\u5177\uff0c\u9069\u5408\u9032\u884c\u6578\u64da\u5eab\u7684\u8a2d\u8a08\u3001\u5efa\u6a21\u548c\u7dad\u8b77\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95-yvtvULdElC\">\u6578\u64da\u5eab\u7684\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<p>\u5728\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u4f7f\u7528\u4e3b\u8981\u9ad4\u73fe\u5728\u6578\u64da\u7684\u589e\u522a\u6539\u67e5\uff08CRUD\uff09\u64cd\u4f5c\u4e0a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u64cd\u4f5c\u793a\u4f8b\uff1a<\/p>\n<h3 id=\"1-%e6%95%b8%e6%93%9a%e7%9a%84%e6%8f%92%e5%85%a5-yvtvULdElC\">1. \u6578\u64da\u7684\u63d2\u5165<\/h3>\n<pre><code>INSERT INTO users (username, password, email) VALUES ('testuser', 'password123', 'test@example.com');<\/code><\/pre>\n<h3 id=\"2-%e6%95%b8%e6%93%9a%e7%9a%84%e6%9f%a5%e8%a9%a2-yvtvULdElC\">2. \u6578\u64da\u7684\u67e5\u8a62<\/h3>\n<pre><code>SELECT * FROM users WHERE username = 'testuser';<\/code><\/pre>\n<h3 id=\"3-%e6%95%b8%e6%93%9a%e7%9a%84%e6%9b%b4%e6%96%b0-yvtvULdElC\">3. \u6578\u64da\u7684\u66f4\u65b0<\/h3>\n<pre><code>UPDATE users SET email = 'newemail@example.com' WHERE username = 'testuser';<\/code><\/pre>\n<h3 id=\"4-%e6%95%b8%e6%93%9a%e7%9a%84%e5%88%aa%e9%99%a4-yvtvULdElC\">4. \u6578\u64da\u7684\u522a\u9664<\/h3>\n<pre><code>DELETE FROM users WHERE username = 'testuser';<\/code><\/pre>\n<p>\u9019\u4e9b\u57fa\u672c\u7684\u64cd\u4f5c\u80fd\u5920\u5e6b\u52a9\u958b\u767c\u8005\u5728\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u4e2d\u6709\u6548\u5730\u7ba1\u7406\u7528\u6236\u6578\u64da\uff0c\u4e26\u78ba\u4fdd\u6578\u64da\u7684\u6e96\u78ba\u6027\u548c\u53ca\u6642\u6027\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%ae%89%e5%85%a8%e6%80%a7-yvtvULdElC\">\u6578\u64da\u5eab\u7684\u5b89\u5168\u6027<\/h2>\n<p>\u5728\u7ba1\u7406\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u7684\u5f8c\u53f0\u6578\u64da\u5eab\u6642\uff0c\u6578\u64da\u5b89\u5168\u6027\u662f\u4e0d\u53ef\u5ffd\u8996\u7684\u554f\u984c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u63d0\u9ad8\u6578\u64da\u5eab\u5b89\u5168\u6027\u7684\u5efa\u8b70\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u5f37\u5bc6\u78bc\uff1a<\/strong>\u78ba\u4fdd\u6578\u64da\u5eab\u7528\u6236\u4f7f\u7528\u5f37\u5bc6\u78bc\uff0c\u9632\u6b62\u672a\u7d93\u6388\u6b0a\u7684\u8a2a\u554f\u3002<\/li>\n<li><strong>\u5b9a\u671f\u5099\u4efd\uff1a<\/strong>\u5b9a\u671f\u5c0d\u6578\u64da\u5eab\u9032\u884c\u5099\u4efd\uff0c\u4ee5\u9632\u6578\u64da\u4e1f\u5931\u6216\u640d\u58de\u3002<\/li>\n<li><strong>\u9650\u5236\u8a2a\u554f\u6b0a\u9650\uff1a<\/strong>\u6839\u64da\u9700\u8981\u9650\u5236\u7528\u6236\u7684\u8a2a\u554f\u6b0a\u9650\uff0c\u78ba\u4fdd\u53ea\u6709\u6388\u6b0a\u7528\u6236\u624d\u80fd\u8a2a\u554f\u654f\u611f\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-yvtvULdElC\">\u7e3d\u7d50<\/h2>\n<p>\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u7684\u5f8c\u53f0\u6578\u64da\u5eab\u7ba1\u7406\u8207\u4f7f\u7528\u662f\u78ba\u4fdd\u61c9\u7528\u7a0b\u5e8f\u7a69\u5b9a\u904b\u884c\u7684\u57fa\u790e\u3002\u901a\u904e\u5408\u7406\u7684\u6578\u64da\u5eab\u8a2d\u8a08\u3001\u6709\u6548\u7684\u7ba1\u7406\u5de5\u5177\u548c\u5b89\u5168\u63aa\u65bd\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u63d0\u5347\u6578\u64da\u7684\u5b58\u53d6\u6548\u7387\u548c\u5b89\u5168\u6027\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u80fd\u548c\u7a69\u5b9a\u6027\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4e5f\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002\u7121\u8ad6\u662f\u9078\u64c7 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u9084\u662f\u5176\u4ed6\u985e\u578b\u7684 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a>\uff0c\u90fd\u80fd\u70ba\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u63d0\u4f9b\u7a69\u5b9a\u7684\u5f8c\u53f0\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u7d05\u5b69\u5b50\u5ba2\u6237\u7aef\u5f8c\u53f0\u6578\u64da\u5eab\u7ba1\u7406\u8207\u4f7f\u7528\uff0c\u63d0\u5347\u6578\u64da\u8655\u7406\u6548\u7387\uff0c\u512a\u5316\u7528\u6236\u9ad4\u9a57\uff0c\u5be6\u73fe\u667a\u80fd\u5316\u7ba1\u7406\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-158987","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/158987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=158987"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/158987\/revisions"}],"predecessor-version":[{"id":158988,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/158987\/revisions\/158988"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=158987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=158987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=158987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}