{"id":17018,"date":"2023-12-09T04:01:06","date_gmt":"2023-12-08T20:01:06","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=17018"},"modified":"2023-12-09T04:09:17","modified_gmt":"2023-12-08T20:09:17","slug":"chang-jian-mian-shi-ti","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/09\/chang-jian-mian-shi-ti\/","title":{"rendered":"\u5e38\u89c1\u9762\u8bd5\u9898"},"content":{"rendered":"<h2><a id=\"%E8%B0%88%E8%B0%88%E4%BD%A0%E5%AF%B9springspringmvcspringboot%E7%9A%84%E8%AE%A4%E8%AF%86\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8c08\u8c08\u4f60\u5bf9Spring\/SpringMVC\/SpringBoot\u7684\u8ba4\u8bc6<\/h2>\n<p>Spring\u662f\u7efc\u5408\u6027\u7684\u5f00\u53d1\u6846\u67b6\uff0c\u63d0\u4f9bIoC\u548cAOP\u6838\u5fc3\u7279\u6027\u3002Spring MVC\u662f\u7528\u4e8e\u6784\u5efaWeb\u5e94\u7528\u7684\u6a21\u5757\uff0c\u57fa\u4e8eMVC\u6a21\u5f0f\u3002Spring Boot\u662f\u57fa\u4e8eSpring\u7684\u5feb\u901f\u5f00\u53d1\u6846\u67b6\uff0c\u7b80\u5316\u4e86\u914d\u7f6e\uff0c\u63d0\u4f9b\u4e86\u5f00\u7bb1\u5373\u7528\u7684\u7279\u6027\uff0c\u52a0\u901f\u4e86\u9879\u76ee\u7684\u642d\u5efa\u548c\u5f00\u53d1\u3002<\/p>\n<h2><a id=\"%E4%BD%A0%E7%9F%A5%E9%81%93%E7%9A%84%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%9C%89%E5%93%AA%E4%BA%9B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u4f60\u77e5\u9053\u7684\u963f\u91cc\u5df4\u5df4\u7f16\u7801\u89c4\u8303\u6709\u54ea\u4e9b<\/h2>\n<p>\u963f\u91cc\u5df4\u5df4\u7f16\u7801\u89c4\u8303\u5305\u62ec\u826f\u597d\u7684\u547d\u540d\u89c4\u8303\u3001\u4e00\u81f4\u7684\u4ee3\u7801\u98ce\u683c\u3001\u6e05\u6670\u7684\u6ce8\u91ca\u3001\u89c4\u8303\u7684\u5f02\u5e38\u5904\u7406\u7b49\u3002\u5f3a\u8c03\u4ee3\u7801\u53ef\u8bfb\u6027\u3001\u53ef\u7ef4\u62a4\u6027\uff0c\u63d0\u5021\u826f\u597d\u7684\u7f16\u7801\u4e60\u60ef\uff0c\u4f8b\u5982\u907f\u514d\u786c\u7f16\u7801\u3001\u5168\u5c40\u53d8\u91cf\uff0c\u4f7f\u7528equals()\u8fdb\u884c\u5bf9\u8c61\u6bd4\u8f83\u7b49\u3002\u5728\u9762\u8bd5\u4e2d\uff0c\u4e86\u89e3\u5e76\u9075\u5faa\u8fd9\u4e9b\u89c4\u8303\u8868\u660e\u5f00\u53d1\u8005\u6ce8\u91cd\u4ee3\u7801\u8d28\u91cf\u548c\u56e2\u961f\u534f\u4f5c\u3002<\/p>\n<h2><a id=\"servlet%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>Servlet\u7684\u751f\u547d\u5468\u671f<\/h2>\n<p>Servlet\u7684\u751f\u547d\u5468\u671f\u5305\u62ec\u52a0\u8f7d\u9636\u6bb5\uff08Load\uff09\u3001\u521d\u59cb\u5316\u9636\u6bb5\uff08Init\uff09\u3001\u670d\u52a1\u9636\u6bb5\uff08Service\uff09\u3002\u5728\u52a0\u8f7d\u65f6\uff0cServlet\u7c7b\u88ab\u52a0\u8f7d\uff1b\u521d\u59cb\u5316\u65f6\uff0c\u8c03\u7528<code>init<\/code>\u65b9\u6cd5\u8fdb\u884c\u4e00\u6b21\u6027\u521d\u59cb\u5316\uff1b\u670d\u52a1\u65f6\uff0c\u5904\u7406\u5ba2\u6237\u7aef\u8bf7\u6c42\uff0c\u6bcf\u6b21\u8bf7\u6c42\u8c03\u7528<code>service<\/code>\u65b9\u6cd5\u3002<\/p>\n<h2><a id=\"%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8json%E8%BF%9B%E8%A1%8C%E5%89%8D%E5%90%8E%E7%AB%AF%E6%95%B0%E6%8D%AE%E4%BA%A4%E4%BA%92\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5982\u4f55\u4f7f\u7528json\u8fdb\u884c\u524d\u540e\u7aef\u6570\u636e\u4ea4\u4e92<\/h2>\n<p>\u524d\u7aef\u53ef\u4ee5\u4f7f\u7528<code>JSON.stringify(data)<\/code>\u5c06\u6570\u636e\u8f6c\u6362\u4e3aJSON\u5b57\u7b26\u4e32\uff0c\u7136\u540e\u901a\u8fc7XMLHttpRequest\u3001Fetch API\u6216\u6846\u67b6\u63d0\u4f9b\u7684HTTP\u5e93\u53d1\u9001\u6570\u636e\u5230\u540e\u7aef\u3002\u540e\u7aef\u63a5\u6536JSON\u6570\u636e\u540e\uff0c\u4f7f\u7528JSON\u5e93\u89e3\u6790\u4e3a\u5bf9\u8c61\uff0c\u5904\u7406\u4e1a\u52a1\u903b\u8f91\uff0c\u5e76\u5c06\u5904\u7406\u7ed3\u679c\u8f6c\u6362\u4e3aJSON\u54cd\u5e94\u8fd4\u56de\u7ed9\u524d\u7aef\u3002\u524d\u7aef\u518d\u901a\u8fc7<code>JSON.parse(responseData)<\/code>\u89e3\u6790\u54cd\u5e94\uff0c\u8fdb\u884c\u754c\u9762\u66f4\u65b0\u6216\u5176\u4ed6\u64cd\u4f5c\u3002\u8fd9\u79cd\u65b9\u5f0f\u5b9e\u73b0\u4e86\u524d\u540e\u7aef\u4e4b\u95f4\u7684\u6570\u636e\u4ea4\u4e92\u3002<\/p>\n<h2><a id=\"%E5%9C%A8%E5%89%8D%E5%90%8E%E7%AB%AF%E5%88%86%E7%A6%BB%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0%E8%AE%B0%E4%BD%8F%E7%94%A8%E6%88%B7%E5%90%8D%E5%8A%9F%E8%83%BD%EF%BC%88%E5%85%B7%E4%BD%93%E7%9A%84%E6%B5%81%E7%A8%8B%EF%BC%89\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5728\u524d\u540e\u7aef\u5206\u79bb\u7684\u9879\u76ee\u4e2d\u5982\u4f55\u5b9e\u73b0\u8bb0\u4f4f\u7528\u6237\u540d\u529f\u80fd\uff08\u5177\u4f53\u7684\u6d41\u7a0b\uff09<\/h2>\n<p>\u5728\u524d\u540e\u7aef\u5206\u79bb\u7684\u9879\u76ee\u4e2d\u5b9e\u73b0\u8bb0\u4f4f\u7528\u6237\u540d\u529f\u80fd\u7684\u4e00\u822c\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n<strong>\u524d\u7aef\uff1a<\/strong><\/p>\n<ul>\n<li>\u63d0\u4f9b\u4e00\u4e2a\u201c\u8bb0\u4f4f\u7528\u6237\u540d\u201d\u7684\u590d\u9009\u6846\u4f9b\u7528\u6237\u9009\u62e9\u3002<\/li>\n<li>\u5982\u679c\u7528\u6237\u52fe\u9009\u4e86\u8be5\u9009\u9879\uff0c\u524d\u7aef\u901a\u8fc7\u6d4f\u89c8\u5668\u7684\u672c\u5730\u5b58\u50a8\uff08localStorage\u6216sessionStorage\uff09\u6216Cookie\u4fdd\u5b58\u7528\u6237\u540d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u540e\u7aef\uff1a<\/strong><\/p>\n<ul>\n<li>\u5904\u7406\u767b\u5f55\u8bf7\u6c42\u65f6\uff0c\u68c0\u67e5\u662f\u5426\u5305\u542b\u201c\u8bb0\u4f4f\u7528\u6237\u540d\u201d\u7684\u6807\u8bc6\u3002<\/li>\n<li>\u5982\u679c\u5305\u542b\uff0c\u751f\u6210\u4e00\u4e2a\u6301\u4e45\u6027\u7684Token\uff0c\u5e76\u8fd4\u56de\u7ed9\u524d\u7aef\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u4e0b\u6b21\u8bbf\u95ee\u65f6\uff1a<\/strong><\/p>\n<ul>\n<li>\u6d4f\u89c8\u5668\u81ea\u52a8\u53d1\u9001\u4fdd\u5b58\u7684Token\u7ed9\u540e\u7aef\u3002<\/li>\n<li>\u540e\u7aef\u9a8c\u8bc1Token\u7684\u6709\u6548\u6027\uff0c\u5982\u679c\u6709\u6548\uff0c\u8fd4\u56de\u7528\u6237\u540d\u7ed9\u524d\u7aef\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u8fd9\u6837\uff0c\u5728\u7528\u6237\u4e0b\u6b21\u8bbf\u95ee\u65f6\uff0c\u7528\u6237\u540d\u4f1a\u88ab\u81ea\u52a8\u586b\u5145\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u9700\u8981\u6ce8\u610f\u5b89\u5168\u6027\u548cToken\u7684\u6709\u6548\u671f\u7ba1\u7406\u3002<\/p>\n<h2><a id=\"%E5%88%9B%E5%BB%BAvue%E7%9A%84%E4%B8%A4%E7%A7%8D%E6%96%B9%E6%B3%95%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%8C%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u521b\u5efaVue\u7684\u4e24\u79cd\u65b9\u6cd5\u662f\u4ec0\u4e48\uff0c\u6709\u4ec0\u4e48\u533a\u522b<\/h2>\n<p>\u521b\u5efaVue\u7684\u4e24\u79cd\u65b9\u6cd5\u662f\u901a\u8fc7CDN\u5f15\u5165\u548c\u4f7f\u7528Vue CLI\uff08\u811a\u624b\u67b6\uff09\u3002<\/p>\n<ol>\n<li>\n<strong>CDN\u5f15\u5165\uff1a<\/strong><\/p>\n<ul>\n<li>\u901a\u8fc7\u5728HTML\u6587\u4ef6\u4e2d\u5f15\u5165Vue\u7684CDN\u5730\u5740\uff0c\u9002\u7528\u4e8e\u7b80\u5355\u9879\u76ee\u6216\u5b66\u4e60\u9636\u6bb5\u3002<\/li>\n<li>\u4f18\u70b9\u662f\u7b80\u5355\u5feb\u901f\uff0c\u7f3a\u70b9\u662f\u65e0\u6cd5\u4f7f\u7528Vue CLI\u63d0\u4f9b\u7684\u4e00\u4e9b\u5f00\u53d1\u5de5\u5177\u548c\u4f18\u5316\u529f\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Vue CLI\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u5b89\u88c5Vue CLI\uff0c\u521b\u5efa\u548c\u7ba1\u7406\u9879\u76ee\u3002<\/li>\n<li>\u9002\u7528\u4e8e\u5927\u578b\u3001\u590d\u6742\u7684\u9879\u76ee\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5f00\u53d1\u5de5\u5177\u548c\u529f\u80fd\u3002<\/li>\n<li>\u9700\u8981\u5728\u672c\u5730\u5b89\u88c5Node.js\u548cnpm\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u9009\u62e9\u65b9\u6cd5\u53d6\u51b3\u4e8e\u9879\u76ee\u7684\u89c4\u6a21\u548c\u590d\u6742\u6027\u3002 CDN\u5f15\u5165\u9002\u7528\u4e8e\u7b80\u5355\u9879\u76ee\uff0c\u800cVue CLI\u66f4\u9002\u5408\u5927\u578b\u548c\u590d\u6742\u7684\u5e94\u7528\u3002<\/p>\n<h2><a id=\"map%E6%8E%A5%E5%8F%A3%E7%9A%84%E5%AD%90%E7%B1%BB%EF%BC%8Chashmap%E7%9A%84%E7%89%B9%E7%82%B9%EF%BC%8Chashtable%E7%9A%84%E7%89%B9%E7%82%B9%EF%BC%8C%E4%BB%96%E4%BF%A9%E7%9A%84%E5%8C%BA%E5%88%AB\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>Map\u63a5\u53e3\u7684\u5b50\u7c7b\uff0cHashMap\u7684\u7279\u70b9\uff0cHashtable\u7684\u7279\u70b9\uff0c\u4ed6\u4fe9\u7684\u533a\u522b<\/h2>\n<p><strong>HashMap\uff1a<\/strong><\/p>\n<ul>\n<li>\u975e\u7ebf\u7a0b\u5b89\u5168\uff0c\u9002\u7528\u4e8e\u5355\u7ebf\u7a0b\u73af\u5883\u6216\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\u91c7\u53d6\u989d\u5916\u540c\u6b65\u63aa\u65bd\u3002<\/li>\n<li>\u5141\u8bb8\u952e\u503c\u4e3a <code>null<\/code>\u3002<\/li>\n<li>\u901a\u5e38\u5728\u6027\u80fd\u4e0a\u4f18\u4e8e <code>Hashtable<\/code>\u3002<\/li>\n<\/ul>\n<p><strong>Hashtable\uff1a<\/strong><\/p>\n<ul>\n<li>\u7ebf\u7a0b\u5b89\u5168\uff0c\u9002\u7528\u4e8e\u591a\u7ebf\u7a0b\u73af\u5883\u3002<\/li>\n<li>\u4e0d\u5141\u8bb8\u952e\u6216\u503c\u4e3a <code>null<\/code>\u3002<\/li>\n<li>\u6027\u80fd\u901a\u5e38\u8f83\u5dee\uff0c\u56e0\u4e3a\u9700\u8981\u7ef4\u62a4\u7ebf\u7a0b\u5b89\u5168\u7684\u5f00\u9500\u3002<\/li>\n<\/ul>\n<p><strong>\u533a\u522b\uff1a<\/strong><\/p>\n<ul>\n<li><code>HashMap<\/code> \u975e\u7ebf\u7a0b\u5b89\u5168\uff0c\u800c <code>Hashtable<\/code> \u7ebf\u7a0b\u5b89\u5168\u3002<\/li>\n<li><code>HashMap<\/code> \u5141\u8bb8\u952e\u503c\u4e3a <code>null<\/code>\uff0c\u800c <code>Hashtable<\/code> \u4e0d\u5141\u8bb8\u3002<\/li>\n<li><code>HashMap<\/code> \u901a\u5e38\u6027\u80fd\u4f18\u4e8e <code>Hashtable<\/code>\u3002<\/li>\n<li><code>HashMap<\/code> \u8fed\u4ee3\u5668\u662f\u5feb\u901f\u5931\u8d25\u7684\uff0c\u800c <code>Hashtable<\/code> \u7684\u8fed\u4ee3\u5668\u662f\u5b89\u5168\u7684\u3002<\/li>\n<\/ul>\n<h2><a id=\"%E9%93%BE%E8%A1%A8%E5%92%8C%E6%95%B0%E7%BB%84%E7%9A%84%E5%8C%BA%E5%88%AB\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u94fe\u8868\u548c\u6570\u7ec4\u7684\u533a\u522b<\/h2>\n<p><strong>\u6570\u7ec4\uff1a<\/strong><\/p>\n<ul>\n<li>\u5185\u5b58\u4e2d\u8fde\u7eed\u5b58\u50a8\u3002<\/li>\n<li>\u5927\u5c0f\u56fa\u5b9a\uff0c\u65e0\u6cd5\u52a8\u6001\u6539\u53d8\u3002<\/li>\n<li>\u901a\u8fc7\u7d22\u5f15\u76f4\u63a5\u8bbf\u95ee\u5143\u7d20\uff0c\u8bbf\u95ee\u901f\u5ea6\u5feb\u3002<\/li>\n<li>\u63d2\u5165\u548c\u5220\u9664\u53ef\u80fd\u9700\u8981\u79fb\u52a8\u5176\u4ed6\u5143\u7d20\u3002<\/li>\n<\/ul>\n<p><strong>\u94fe\u8868\uff1a<\/strong><\/p>\n<ul>\n<li>\u5185\u5b58\u4e2d\u975e\u8fde\u7eed\u5b58\u50a8\uff0c\u901a\u8fc7\u6307\u9488\u8fde\u63a5\u3002<\/li>\n<li>\u5927\u5c0f\u53ef\u53d8\uff0c\u52a8\u6001\u589e\u51cf\u5143\u7d20\u3002<\/li>\n<li>\u904d\u5386\u8bbf\u95ee\uff0c\u8bbf\u95ee\u901f\u5ea6\u8f83\u6162\u3002<\/li>\n<li>\u63d2\u5165\u548c\u5220\u9664\u64cd\u4f5c\u76f8\u5bf9\u5feb\u901f\uff0c\u53ea\u9700\u8c03\u6574\u6307\u9488\u3002<\/li>\n<\/ul>\n<h2><a id=\"%E6%95%B0%E6%8D%AE%E5%BA%93%E6%9C%89%E4%B8%80%E4%B8%AAvarchar%E5%AD%97%E6%AE%B5%E5%AD%98%E5%82%A8%E7%9A%84%E6%95%B0%E6%8D%AE%E8%B6%85%E5%87%BA%E4%BA%86%E9%99%90%E5%88%B6%E9%95%BF%E5%BA%A6%EF%BC%8C%E4%BD%A0%E6%9C%89%E4%BB%80%E4%B9%88%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u6570\u636e\u5e93\u6709\u4e00\u4e2avarchar\u5b57\u6bb5\u5b58\u50a8\u7684\u6570\u636e\u8d85\u51fa\u4e86\u9650\u5236\u957f\u5ea6\uff0c\u4f60\u6709\u4ec0\u4e48\u89e3\u51b3\u65b9\u6cd5<\/h2>\n<p>\u9762\u5bf9\u6570\u636e\u5e93\u4e2d VARCHAR \u5b57\u6bb5\u5b58\u50a8\u7684\u6570\u636e\u8d85\u51fa\u9650\u5236\u957f\u5ea6\u7684\u60c5\u51b5\uff0c\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6cd5\u5305\u62ec\u4fee\u590d\u6570\u636e\u3001\u6269\u5c55\u5b57\u6bb5\u957f\u5ea6\u3001\u6570\u636e\u8fc1\u79fb\u3001\u4f7f\u7528 TEXT \u7c7b\u578b\uff0c\u4ee5\u53ca\u5728\u5e94\u7528\u5c42\u8fdb\u884c\u957f\u5ea6\u68c0\u67e5\u3002\u9009\u62e9\u89e3\u51b3\u65b9\u6848\u65f6\u9700\u8981\u8c28\u614e\uff0c\u786e\u4fdd\u5bf9\u73b0\u6709\u7cfb\u7edf\u6ca1\u6709\u8d1f\u9762\u5f71\u54cd\uff0c\u53ef\u80fd\u9700\u8981\u8003\u8651\u5907\u4efd\u6570\u636e\u4ee5\u53ca\u4e0e\u56e2\u961f\u534f\u8c03\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<h2><a id=\"%E6%9C%89%E4%B8%A4%E4%B8%AA%E7%B1%BBa%E5%92%8Cb%EF%BC%8C%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0c%E7%B1%BB%E5%90%8C%E6%97%B6%E6%8B%A5%E6%9C%89a%E5%92%8Cb%E7%B1%BB%E7%9A%84%E5%8A%9F%E8%83%BD\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u6709\u4e24\u4e2a\u7c7bA\u548cB\uff0c\u5982\u4f55\u5b9e\u73b0C\u7c7b\u540c\u65f6\u62e5\u6709A\u548cB\u7c7b\u7684\u529f\u80fd<\/h2>\n<p>\u5728Java\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a\u65b0\u7c7bC\uff0c\u4f7f\u5176\u540c\u65f6\u7ee7\u627f\u7c7bA\u5e76\u5b9e\u73b0\u5305\u542b\u7c7bB\u529f\u80fd\u7684\u63a5\u53e3\u3002\u8fd9\u6837\uff0c\u7c7bC\u5c31\u80fd\u591f\u540c\u65f6\u62e5\u6709\u7c7bA\u548c\u7c7bB\u7684\u529f\u80fd\u3002\u8fd9\u79cd\u65b9\u5f0f\u901a\u8fc7\u7ee7\u627f\u548c\u63a5\u53e3\u5b9e\u73b0\u6765\u8fbe\u5230\u591a\u529f\u80fd\u7ec4\u5408\u7684\u6548\u679c\u3002<\/p>\n<h2><a id=\"%E5%A6%82%E4%BD%95%E4%BC%98%E5%8C%96mysql%E8%AF%AD%E5%8F%A5%EF%BC%8C%E6%8F%90%E9%AB%98%E6%95%88%E7%8E%87\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5982\u4f55\u4f18\u5316MySQL\u8bed\u53e5\uff0c\u63d0\u9ad8\u6548\u7387<\/h2>\n<p>\u5728MySQL\u8bed\u53e5\u4f18\u5316\u65b9\u9762\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n<ol>\n<li>\n<strong>\u7d22\u5f15\u4f18\u5316\uff1a<\/strong> \u4e3a\u7ecf\u5e38\u67e5\u8be2\u7684\u5217\u521b\u5efa\u5408\u9002\u7684\u7d22\u5f15\uff0c\u907f\u514d\u8fc7\u5ea6\u7d22\u5f15\u3002\u8003\u8651\u4f7f\u7528\u590d\u5408\u7d22\u5f15\u3002\n<\/li>\n<li>\n<strong>\u67e5\u8be2\u4f18\u5316\uff1a<\/strong> \u4ec5\u9009\u62e9\u9700\u8981\u7684\u5217\uff0c\u907f\u514d\u4f7f\u7528<code>SELECT *<\/code>\uff0c\u4f7f\u7528<code>LIMIT<\/code>\u9650\u5236\u8fd4\u56de\u7684\u884c\u6570\u3002\n<\/li>\n<li>\n<strong>\u907f\u514d\u5168\u8868\u626b\u63cf\uff1a<\/strong> \u786e\u4fdd<code>WHERE<\/code>\u5b50\u53e5\u4e2d\u5305\u542b\u7d22\u5f15\u5217\uff0c\u907f\u514d\u5168\u8868\u626b\u63cf\u3002\n<\/li>\n<li>\n<strong>\u5206\u6790\u548c\u4f18\u5316\u67e5\u8be2\u8ba1\u5212\uff1a<\/strong> \u4f7f\u7528<code>EXPLAIN<\/code>\u5206\u6790\u67e5\u8be2\u8ba1\u5212\uff0c\u786e\u4fddMySQL\u9009\u62e9\u4e86\u6b63\u786e\u7684\u7d22\u5f15\u3002\n<\/li>\n<li>\n<strong>\u4f7f\u7528\u5408\u9002\u7684\u6570\u636e\u7c7b\u578b\uff1a<\/strong> \u4f7f\u7528\u6700\u5c0f\u53ef\u80fd\u7684\u6570\u636e\u7c7b\u578b\uff0c\u907f\u514d\u5728<code>WHERE<\/code>\u5b50\u53e5\u4e2d\u4f7f\u7528<code>OR<\/code>\uff0c\u6539\u7528<code>IN<\/code>\u3002\n<\/li>\n<li>\n<strong>\u5206\u8868\u5206\u5e93\uff1a<\/strong> \u5bf9\u4e8e\u5927\u8868\uff0c\u8003\u8651\u5206\u8868\u5206\u5e93\uff0c\u51cf\u8f7b\u5355\u8868\u8d1f\u62c5\u3002\n<\/li>\n<li>\n<strong>\u5b9a\u671f\u4f18\u5316\u8868\uff1a<\/strong> \u4f7f\u7528<code>OPTIMIZE TABLE<\/code>\u547d\u4ee4\u4f18\u5316\u8868\uff0c\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\u5e76\u63d0\u9ad8\u6027\u80fd\u3002\n<\/li>\n<li>\n<strong>\u7f13\u5b58\u67e5\u8be2\u7ed3\u679c\uff1a<\/strong> \u4f7f\u7528\u7f13\u5b58\u5b58\u50a8\u7ecf\u5e38\u4f7f\u7528\u7684\u67e5\u8be2\u7ed3\u679c\uff0c\u51cf\u8f7b\u6570\u636e\u5e93\u8d1f\u8f7d\u3002\n<\/li>\n<li>\n<strong>\u4f7f\u7528\u8fde\u63a5\u6c60\uff1a<\/strong> \u4f7f\u7528\u8fde\u63a5\u6c60\u51cf\u5c11\u8fde\u63a5\u548c\u65ad\u5f00\u8fde\u63a5\u7684\u5f00\u9500\u3002\n<\/li>\n<li>\n<strong>\u907f\u514d\u5728\u6570\u636e\u5e93\u5c42\u8fdb\u884c\u5927\u91cf\u8ba1\u7b97\uff1a<\/strong> \u5c06\u8ba1\u7b97\u79fb\u5230\u5e94\u7528\u5c42\uff0c\u51cf\u8f7b\u6570\u636e\u5e93\u8d1f\u62c5\u3002\n<\/li>\n<li>\n<strong>\u9009\u62e9\u5408\u9002\u7684\u5b58\u50a8\u5f15\u64ce\uff1a<\/strong> \u6839\u636e\u4e1a\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5b58\u50a8\u5f15\u64ce\u3002\n<\/li>\n<\/ol>\n<p>\u8fd9\u4e9b\u4f18\u5316\u7b56\u7565\u53ef\u4ee5\u5e2e\u52a9\u63d0\u9ad8\u6570\u636e\u5e93\u67e5\u8be2\u6548\u7387\u548c\u6027\u80fd\u3002<\/p>\n<h2><a id=\"%E8%AF%B4%E8%AF%B4%E4%BD%A0%E5%9C%A8%E9%A1%B9%E7%9B%AE%E4%B8%AD%E6%9C%80%E6%9C%89%E6%88%90%E5%B0%B1%E6%84%9F%E7%9A%84%E4%B8%80%E4%BB%B6%E4%BA%8B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8bf4\u8bf4\u4f60\u5728\u9879\u76ee\u4e2d\u6700\u6709\u6210\u5c31\u611f\u7684\u4e00\u4ef6\u4e8b<\/h2>\n<p>\u5f53\u56de\u7b54\u5173\u4e8e\u5728\u9879\u76ee\u4e2d\u6700\u6709\u6210\u5c31\u611f\u7684\u4e00\u4ef6\u4e8b\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6846\u67b6\uff1a<\/p>\n<ol>\n<li>\n<strong>\u9879\u76ee\u80cc\u666f\uff1a<\/strong><\/p>\n<ul>\n<li>\u4ecb\u7ecd\u6240\u6d89\u53ca\u7684\u9879\u76ee\uff0c\u5305\u62ec\u9879\u76ee\u7684\u89c4\u6a21\u3001\u76ee\u6807\u3001\u4ee5\u53ca\u4f60\u5728\u9879\u76ee\u4e2d\u627f\u62c5\u7684\u89d2\u8272\u548c\u8d23\u4efb\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u6311\u6218\u63cf\u8ff0\uff1a<\/strong><\/p>\n<ul>\n<li>\u63cf\u8ff0\u5728\u9879\u76ee\u4e2d\u9047\u5230\u7684\u4e00\u4e2a\u5177\u4f53\u6311\u6218\u6216\u95ee\u9898\uff0c\u8ba9\u9762\u8bd5\u5b98\u4e86\u89e3\u9879\u76ee\u7684\u590d\u6742\u6027\u548c\u4f60\u6240\u9762\u5bf9\u7684\u96be\u9898\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<ul>\n<li>\u9610\u8ff0\u4f60\u4e3a\u89e3\u51b3\u8fd9\u4e2a\u6311\u6218\u91c7\u53d6\u7684\u5177\u4f53\u63aa\u65bd\u548c\u7b56\u7565\u3002\u8bf4\u660e\u4f60\u662f\u5982\u4f55\u5206\u6790\u95ee\u9898\u3001\u5236\u5b9a\u8ba1\u5212\uff0c\u5e76\u4e0e\u56e2\u961f\u5408\u4f5c\u6765\u514b\u670d\u56f0\u96be\u7684\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u6267\u884c\u8fc7\u7a0b\uff1a<\/strong><\/p>\n<ul>\n<li>\u8be6\u7ec6\u8bf4\u660e\u4f60\u5728\u5b9e\u65bd\u89e3\u51b3\u65b9\u6848\u8fc7\u7a0b\u4e2d\u7684\u5177\u4f53\u6b65\u9aa4\uff0c\u5305\u62ec\u6280\u672f\u9009\u578b\u3001\u6c9f\u901a\u534f\u8c03\u3001\u56e2\u961f\u5408\u4f5c\u7b49\u65b9\u9762\u7684\u5de5\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5173\u952e\u8d21\u732e\uff1a<\/strong><\/p>\n<ul>\n<li>\u5f3a\u8c03\u4f60\u5728\u9879\u76ee\u4e2d\u7684\u5173\u952e\u8d21\u732e\uff0c\u4f8b\u5982\u662f\u5426\u5f15\u5165\u4e86\u65b0\u7684\u6280\u672f\u3001\u63d0\u51fa\u4e86\u521b\u65b0\u6027\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u6216\u8005\u5728\u9879\u76ee\u8fdb\u5ea6\u3001\u8d28\u91cf\u65b9\u9762\u53d6\u5f97\u4e86\u663e\u8457\u7684\u6539\u8fdb\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u6210\u679c\u548c\u5f71\u54cd\uff1a<\/strong><\/p>\n<ul>\n<li>\u8bf4\u660e\u4f60\u7684\u5de5\u4f5c\u53d6\u5f97\u4e86\u4ec0\u4e48\u5177\u4f53\u7684\u6210\u679c\uff0c\u5e76\u5bf9\u6574\u4e2a\u9879\u76ee\u4ea7\u751f\u4e86\u4ec0\u4e48\u6837\u7684\u79ef\u6781\u5f71\u54cd\u3002\u53ef\u4ee5\u5305\u62ec\u63d0\u9ad8\u6548\u7387\u3001\u51cf\u5c11\u6210\u672c\u3001\u4f18\u5316\u7528\u6237\u4f53\u9a8c\u7b49\u65b9\u9762\u7684\u6548\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5b66\u4e60\u548c\u6210\u957f\uff1a<\/strong><\/p>\n<ul>\n<li>\u63d0\u5230\u5728\u89e3\u51b3\u8fd9\u4e2a\u6311\u6218\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u5b66\u5230\u4e86\u4ec0\u4e48\u65b0\u77e5\u8bc6\uff0c\u79ef\u7d2f\u4e86\u54ea\u4e9b\u7ecf\u9a8c\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u672a\u6765\u7684\u9879\u76ee\u4e2d\u5e94\u7528\u8fd9\u4e9b\u7ecf\u9a8c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u56e2\u961f\u5408\u4f5c\uff1a<\/strong><\/p>\n<ul>\n<li>\u5f3a\u8c03\u4f60\u5728\u56e2\u961f\u4e2d\u7684\u5408\u4f5c\u4e0e\u9886\u5bfc\u80fd\u529b\uff0c\u8bf4\u660e\u4e0e\u56e2\u961f\u6210\u5458\u3001\u9886\u5bfc\u6216\u5176\u4ed6\u90e8\u95e8\u7684\u534f\u4f5c\u5173\u7cfb\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u6210\u5c31\u611f\u4f53\u9a8c\uff1a<\/strong><\/p>\n<ul>\n<li>\u6700\u540e\uff0c\u8868\u8fbe\u4f60\u5728\u514b\u670d\u8fd9\u4e2a\u6311\u6218\u7684\u8fc7\u7a0b\u4e2d\u6240\u611f\u53d7\u5230\u7684\u6210\u5c31\u611f\u548c\u81ea\u8c6a\u611f\uff0c\u4ee5\u53ca\u8fd9\u6b21\u7ecf\u5386\u5bf9\u4f60\u804c\u4e1a\u53d1\u5c55\u7684\u5f71\u54cd\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u4f8b\u5b50\uff1a<br \/>\n\u5728\u6211\u4eec\u6700\u8fd1\u7684\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u9762\u4e34\u4e86\u4e00\u4e2a\u6027\u80fd\u74f6\u9888\u7684\u6311\u6218\uff0c\u5bfc\u81f4\u7cfb\u7edf\u54cd\u5e94\u65f6\u95f4\u8fc7\u957f\u3002\u4f5c\u4e3a\u56e2\u961f\u7684\u4e00\u5458\uff0c\u6211\u8d1f\u8d23\u8fdb\u884c\u6027\u80fd\u4f18\u5316\u3002\u901a\u8fc7\u4ed4\u7ec6\u5206\u6790\u4ee3\u7801\u3001\u6570\u636e\u5e93\u67e5\u8be2\u4ee5\u53ca\u7cfb\u7edf\u67b6\u6784\uff0c\u6211\u63d0\u51fa\u4e86\u4e00\u7cfb\u5217\u7684\u4f18\u5316\u63aa\u65bd\uff0c\u5305\u62ec\u5f15\u5165\u7f13\u5b58\u673a\u5236\u3001\u4f18\u5316\u6570\u636e\u5e93\u67e5\u8be2\u3001\u5e76\u884c\u5316\u5904\u7406\u7b49\u3002\u5728\u5b9e\u65bd\u8fd9\u4e9b\u63aa\u65bd\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u6210\u529f\u5730\u5c06\u7cfb\u7edf\u7684\u54cd\u5e94\u65f6\u95f4\u4ece10\u79d2\u964d\u4f4e\u52302\u79d2\uff0c\u5927\u5927\u63d0\u5347\u4e86\u7528\u6237\u4f53\u9a8c\u3002\u8fd9\u4e2a\u7ecf\u5386\u8ba9\u6211\u6df1\u523b\u4f53\u4f1a\u5230\u4e86\u56e2\u961f\u534f\u4f5c\u7684\u91cd\u8981\u6027\uff0c\u540c\u65f6\u4e5f\u8ba9\u6211\u5728\u6027\u80fd\u4f18\u5316\u548c\u7cfb\u7edf\u8c03\u4f18\u65b9\u9762\u53d6\u5f97\u4e86\u5b9e\u8d28\u6027\u7684\u6210\u679c\u3002\u8fd9\u4e0d\u4ec5\u662f\u6211\u5728\u6280\u672f\u65b9\u9762\u7684\u4e00\u6b21\u6210\u5c31\uff0c\u4e5f\u662f\u5bf9\u56e2\u961f\u534f\u4f5c\u548c\u95ee\u9898\u89e3\u51b3\u80fd\u529b\u7684\u4e00\u6b21\u953b\u70bc\uff0c\u8ba9\u6211\u66f4\u6709\u4fe1\u5fc3\u5e94\u5bf9\u672a\u6765\u66f4\u5927\u6311\u6218\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8c08\u8c08\u4f60\u5bf9Spring\/SpringMVC\/SpringBoot\u7684\u8ba4\u8bc6 Spring\u662f\u7efc\u5408\u6027\u7684\u5f00\u53d1\u6846\u67b6\uff0c\u63d0\u4f9bIo [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106],"tags":[],"class_list":["post-17018","post","type-post","status-publish","format-standard","hentry","category-gongsi"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/17018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=17018"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/17018\/revisions"}],"predecessor-version":[{"id":17019,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/17018\/revisions\/17019"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=17018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=17018"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=17018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}