{"id":3582,"date":"2018-12-18T15:17:52","date_gmt":"2018-12-18T07:17:52","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3582"},"modified":"2018-12-18T15:17:52","modified_gmt":"2018-12-18T07:17:52","slug":"%e5%88%86%e4%ba%ab%e4%b8%80%e5%a5%97-mysql-%e8%bf%90%e7%bb%b4%e5%8f%8a%e5%bc%80%e5%8f%91%e8%a7%84%e8%8c%83","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3582","title":{"rendered":"\u5206\u4eab\u4e00\u5957 MySQL \u8fd0\u7ef4\u53ca\u5f00\u53d1\u89c4\u8303"},"content":{"rendered":"<p>\n\t\u5728\u53bb IOE \u7684\u8d8b\u52bf\u4e0b\uff0cMySQL \u8d8a\u6765\u8d8a\u6d41\u884c\u3002\u4f46\u662f MySQL \u5f00\u53d1\u89c4\u8303\uff0c\u8bbe\u8ba1\u89c4\u8303\u65b9\u9762\u7684\u6587\u6863\u4e00\u76f4\u4ee5\u6765\u90fd\u662f\u6bd4\u8f83\u5c11\u7684\u3002MySQL \u6570\u636e\u5e93\u8bbe\u8ba1\u7684\u597d\u574f\uff0c\u4f7f\u7528\u7684\u597d\u574f\u5bf9\u4e00\u4e2a\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u663e\u7684\u975e\u5e38\u7684\u91cd\u8981\u3002\u7531\u4e8e\u5404\u5f00\u53d1\u4eba\u5458\u5bf9 MySQL \u4ee5\u53ca\u5f00\u53d1\u6280\u672f\u638c\u63e1\u7684\u60c5\u51b5\u4e0d\u4e00\u6837\uff0c\u5bfc\u81f4\u5728\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u9762\u5b58\u5728\u7740\u4e0d\u5c11\u9519\u8bef\u7684\u5730\u65b9\u3002\u5e0c\u671b\u901a\u8fc7\u672c\u6587\uff0c\u5927\u5bb6\u89c4\u8303\u4e00\u4e0b\uff01\n<\/p>\n<h2>\n\t\u57fa\u7840\u89c4\u8303<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u7528\u5230\u4e8b\u52a1\u7684\uff0c\u5fc5\u987b\u4f7f\u7528 INNODB \u5b58\u50a8\u5f15\u64ce\n\t<\/li>\n<li>\n\t\t\u8868\u5b57\u7b26\u96c6\u4f7f\u7528 UTF8\uff0c\u9700\u8981\u5b58\u50a8\u8868\u60c5\u7684\u7528 utfmb4\n\t<\/li>\n<li>\n\t\t\u6240\u6709\u8868\u90fd\u9700\u8981\u6dfb\u52a0\u6ce8\u91ca\n\t<\/li>\n<li>\n\t\t\u5355\u8868\u6570\u636e\u91cf\u5efa\u8bae\u63a7\u5236\u5728 5000W \u4ee5\u5185\n\t<\/li>\n<li>\n\t\t\u4e0d\u5728\u6570\u636e\u5e93\u4e2d\u5b58\u50a8\u56fe\u3001\u6587\u4ef6\u7b49\u5927\u6570\u636e\n\t<\/li>\n<li>\n\t\t\u7981\u6b62\u5728\u7ebf\u4e0a\u505a\u6570\u636e\u5e93\u538b\u529b\u6d4b\u8bd5\n\t<\/li>\n<li>\n\t\t\u7981\u4ece\u6d4b\u8bd5\u3001\u5f00\u53d1\u73af\u5883\u76f4\u8fde\u6570\u636e\u5e93\n\t<\/li>\n<\/ul>\n<h2>\n\t\u547d\u540d\u89c4\u8303<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u5e93\u540d\u8868\u540d\u5b57\u6bb5\u540d\u5fc5\u987b\u6709\u56fa\u5b9a\u7684\u547d\u540d\u957f\u5ea6\uff0c\u4e25\u7981\u8d85\u8fc7 32 \u4e2a\u5b57\u7b26\n\t<\/li>\n<li>\n\t\t\u5e93\u540d\u3001\u8868\u540d\u3001\u5b57\u6bb5\u540d\u7981\u6b62\u8d85\u8fc7 32 \u4e2a\u5b57\u7b26\u3002\u987b\u89c1\u540d\u4e4b\u610f\n\t<\/li>\n<li>\n\t\t\u5e93\u540d\u3001\u8868\u540d\u3001\u5b57\u6bb5\u540d\u7981\u6b62\u4f7f\u7528 MySQL \u4fdd\u7559\u5b57\n\t<\/li>\n<li>\n\t\t\u4e34\u65f6\u5e93\u3001\u8868\u540d\u5fc5\u987b\u4ee5 tmp \u4e3a\u524d\u7f00\uff0c\u5e76\u4ee5\u65e5\u671f\u4e3a\u540e\u7f00\n\t<\/li>\n<li>\n\t\t\u5907\u4efd\u5e93\u3001\u8868\u5fc5\u987b\u4ee5 bak \u4e3a\u524d\u7f00\uff0c\u5e76\u4ee5\u65e5\u671f\u4e3a\u540e\u7f00\n\t<\/li>\n<\/ul>\n<h2>\n\t\u5e93\u3001\u8868\u3001\u5b57\u6bb5\u5f00\u53d1\u8bbe\u8ba1\u89c4\u8303<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u5408\u7406\u3001\u5c11\u7528\u3001\u6700\u597d\u4e0d\u7528\u7528\u5206\u533a\u8868\n\t<\/li>\n<li>\n\t\t\u62c6\u5206\u5927\u5b57\u6bb5\u548c\u8bbf\u95ee\u9891\u7387\u4f4e\u7684\u5b57\u6bb5\uff0c\u5206\u79bb\u51b7\u70ed\u6570\u636e\n\t<\/li>\n<li>\n\t\t\u7528 HASH \u8fdb\u6563\u8868\uff0c\u8868\u540d\u540e\u7f00\u4f7f\u8fdb\u5236\u6570\uff0c\u4e0b\u6807\u4ece 0 \u5f00\u59cb\n\t<\/li>\n<li>\n\t\t\u6309\u65e5\u671f\u65f6\u95f4\u5206\u8868\u9700\u7b26\u5408 YYYY[MM][DD][HH] \u683c\u5f0f\n\t<\/li>\n<li>\n\t\t\u91c7\u7528\u5408\u9002\u7684\u5206\u5e93\u5206\u8868\u7b56\u7565\u3002\u4f8b\u5982\u5343\u5e93\u5341\u8868\u3001\u5341\u5e93\u767e\u8868\u7b49\n\t<\/li>\n<li>\n\t\t\u5c3d\u53ef\u80fd\u4e0d\u4f7f\u7528 TEXT\u3001BLOB \u7c7b\u578b\n\t<\/li>\n<li>\n\t\t\u7528 DECIMAL \u4ee3\u66ff FLOAT \u548c DOUBLE \u5b58\u50a8\u7cbe\u786e\u6d6e\u70b9\u6570\n\t<\/li>\n<li>\n\t\t\u8d8a\u7b80\u5355\u8d8a\u597d\uff1a\u5c06\u5b57\u7b26\u8f6c\u5316\u4e3a\u6570\u5b57\u3001\u4f7f\u7528 TINYINT \u6765\u4ee3\u66ff ENUM \u7c7b\u578b\n\t<\/li>\n<li>\n\t\t\u6240\u6709\u5b57\u6bb5\u5747\u5b9a\u4e49\u4e3a NOT NULL\n\t<\/li>\n<li>\n\t\t\u4f7f\u7528 UNSIGNED \u5b58\u50a8\u975e\u8d1f\u6574\u6570\n\t<\/li>\n<li>\n\t\tINT \u7c7b\u578b\u56fa\u5b9a\u5360\u7528 4 \u5b57\u8282\u5b58\u50a8\n\t<\/li>\n<li>\n\t\t\u4f7f\u7528 timestamp \u5b58\u50a8\u65f6\u95f4\n\t<\/li>\n<li>\n\t\t\u4f7f\u7528 INT UNSIGNED \u5b58\u50a8 IPV4\n\t<\/li>\n<li>\n\t\t\u4f7f\u7528 VARBINARY \u5b58\u50a8\u5927\u5c0f\u5199\u654f\u611f\u7684\u53d8\u957f\u5b57\u7b26\u4e32\n\t<\/li>\n<li>\n\t\t\u7981\u6b62\u5728\u6570\u636e\u5e93\u4e2d\u5b58\u50a8\u660e\u6587\u5bc6\u7801\uff0c\u628a\u5bc6\u7801\u52a0\u5bc6\u540e\u5b58\u50a8\n\t<\/li>\n<li>\n\t\t\u7528\u597d\u6570\u503c\u7c7b\u578b\u5b57\u6bb5 Tinyint(1Byte)\u3001smallint(2Byte)\u3001mediumint(3Byte)\u3001int(4Byte)\u3001bigint(8Byte) \u5982\u679c\u6570\u503c\u5b57\u6bb5\u6ca1\u6709\u90a3\u4e48\u5927\uff0c\u5c31\u4e0d\u8981\u7528 bigint\n\t<\/li>\n<li>\n\t\t\u5b58\u50a8 ip \u6700\u597d\u7528 int \u5b58\u50a8\u800c\u975e char(15)\n\t<\/li>\n<li>\n\t\t\u4e0d\u5141\u8bb8\u4f7f\u7528 ENUM\n\t<\/li>\n<li>\n\t\t\u907f\u514d\u4f7f\u7528 NULL \u5b57\u6bb5\u3002NULL \u5b57\u6bb5\u5f88\u96be\u67e5\u8be2\u4f18\u5316\uff0cNULL \u5b57\u6bb5\u7684\u7d22\u5f15\u9700\u8981\u989d\u5916\u7a7a\u95f4\uff0cNULL \u5b57\u6bb5\u7684\u590d\u5408\u7d22\u5f15\u65e0\u6548\n\t<\/li>\n<li>\n\t\t\u5c11\u7528 text\/blob\uff0cvarchar \u7684\u6027\u80fd\u4f1a\u6bd4 text \u9ad8\u5f88\u591a\uff0c\u5b9e\u5728\u907f\u514d\u4e0d\u4e86 blob\uff0c\u8bf7\u62c6\u8868\n\t<\/li>\n<li>\n\t\t\u6570\u636e\u5e93\u4e2d\u4e0d\u5141\u8bb8\u5b58\u50a8\u5927\u6587\u4ef6\uff0c\u6216\u8005\u7167\u7247\uff0c\u53ef\u4ee5\u5c06\u5927\u5bf9\u8c61\u653e\u5230\u78c1\u76d8\u4e0a\uff0c\u6570\u636e\u5e93\u4e2d\u5b58\u50a8\u5b83\u7684\u8def\u5f84\n\t<\/li>\n<\/ul>\n<h2>\n\t\u7d22\u5f15\u89c4\u8303<br \/>\n<\/h2>\n<p>\n\t\u7d22\u5f15\u7684\u6570\u91cf\u63a7\u5236\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u5355\u5f20\u8868\u4e2d\u7d22\u5f15\u6570\u91cf\u4e0d\u8d85\u8fc7 5 \u4e2a\n\t<\/li>\n<li>\n\t\t\u5355\u4e2a\u7d22\u5f15\u4e2d\u7684\u5b57\u6bb5\u6570\u4e0d\u8d85\u8fc7 5 \u4e2a\n\t<\/li>\n<li>\n\t\t\u5bf9\u5b57\u7b26\u4e32\u4f7f\u7528\u524d\u7f00\u7d22\u5f15\uff0c\u524d\u7f00\u7d22\u5f15\u957f\u5ea6\u4e0d\u8d85\u8fc7 8 \u4e2a\u5b57\u7b26\n\t<\/li>\n<li>\n\t\t\u5efa\u8bae\u4f18\u5148\u8003\u8651\u524d\u7f00\u7d22\u5f15\uff0c\u5fc5\u8981\u65f6\u53ef\u6dfb\u52a0\u4f2a\u5217\u5e76\u5efa\u7acb\u7d22\u5f15\n\t<\/li>\n<\/ul>\n<p>\n\t\u4e3b\u952e\u51c6\u5219\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u8868\u5fc5\u987b\u6709\u4e3b\u952e\n\t<\/li>\n<li>\n\t\t\u4e0d\u4f7f\u7528\u66f4\u65b0\u9891\u7e41\u7684\u5217\u4f5c\u4e3a\u4e3b\u952e\n\t<\/li>\n<li>\n\t\t\u5c3d\u91cf\u4e0d\u9009\u62e9\u5b57\u7b26\u4e32\u5217\u4f5c\u4e3a\u4e3b\u952e\n\t<\/li>\n<li>\n\t\t\u4e0d\u4f7f\u7528 UUID MD5 HASH \u8fd9\u4e9b\u4f5c\u4e3a\u4e3b\u952e(\u6570\u503c\u592a\u79bb\u6563\u4e86)\n\t<\/li>\n<li>\n\t\t\u9ed8\u8ba4\u4f7f\u975e\u7a7a\u7684\u552f\u4e00\u952e\u4f5c\u4e3a\u4e3b\u952e\n\t<\/li>\n<li>\n\t\t\u5efa\u8bae\u9009\u62e9\u81ea\u589e\u6216\u53d1\u53f7\u5668\n\t<\/li>\n<\/ul>\n<p>\n\t\u91cd\u8981\u7684 SQL \u5fc5\u987b\u88ab\u7d22\u5f15\u3002\n<\/p>\n<ul>\n<li>\n\t\tUPDATE\u3001DELETE \u8bed\u53e5\u7684 WHERE \u6761\u4ef6\u5217\n\t<\/li>\n<li>\n\t\tORDER BY\u3001GROUP BY\u3001DISTINCT \u7684\u5b57\u6bb5\n\t<\/li>\n<\/ul>\n<p>\n\t\u591a\u8868JOIN\u7684\u5b57\u6bb5\u516c\u7ea6\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u533a\u5206\u5ea6\u6700\u5927\u7684\u5b57\u6bb5\u653e\u5728\u524d\u9762\n\t<\/li>\n<li>\n\t\t\u907f\u514d\u5197\u4f59\u548c\u91cd\u590d\u7d22\u5f15\n\t<\/li>\n<li>\n\t\t\u7d22\u5f15\u8981\u7efc\u5408\u8bc4\u4f30\u6570\u636e\u5bc6\u5ea6\u548c\u5206\u5e03\u4ee5\u53ca\u8003\u8651\u67e5\u8be2\u548c\u66f4\u65b0\u6bd4\u4f8b\n\t<\/li>\n<\/ul>\n<p>\n\t\u7d22\u5f15\u7981\u5fcc\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u4e0d\u5728\u4f4e\u57fa\u6570\u5217\u4e0a\u5efa\u7acb\u7d22\u5f15\uff0c\u4f8b\u5982&ldquo;\u6027\u522b&rdquo;\n\t<\/li>\n<li>\n\t\t\u4e0d\u5728\u7d22\u5f15\u5217\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\u548c\u51fd\u6570\u8fd0\u7b97\n\t<\/li>\n<\/ul>\n<p>\n\t\u5c3d\u91cf\u4e0d\u4f7f\u7528\u5916\u952e\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u5916\u952e\u7528\u6765\u4fdd\u62a4\u53c2\u7167\u5b8c\u6574\u6027\uff0c\u53ef\u5728\u4e1a\u52a1\u7aef\u5b9e\u73b0\n\t<\/li>\n<li>\n\t\t\u5bf9\u7236\u8868\u548c\u5b50\u8868\u7684\u64cd\u4f5c\u4f1a\u76f8\u4e92\u5f71\u54cd\uff0c\u964d\u4f4e\u53ef\u7528\u6027\n\t<\/li>\n<\/ul>\n<p>\n\t\u7d22\u5f15\u547d\u540d\uff1a\u975e\u552f\u4e00\u7d22\u5f15\u5fc5\u987b\u4ee5 idx_\u5b57\u6bb51_\u5b57\u6bb52\u547d\u540d\uff0c\u552f\u4e00\u6240\u4ee5\u5fc5\u987b\u4ee5uniq_\u5b57\u6bb51_\u5b57\u6bb52\u547d\u540d\uff0c\u7d22\u5f15\u540d\u79f0\u5fc5\u987b\u5168\u90e8\u5c0f\u5199\u3002\n<\/p>\n<p>\n\t\u65b0\u5efa\u7684\u552f\u4e00\u7d22\u5f15\u5fc5\u987b\u4e0d\u80fd\u548c\u4e3b\u952e\u91cd\u590d\u3002\n<\/p>\n<p>\n\t\u7d22\u5f15\u5b57\u6bb5\u7684\u9ed8\u8ba4\u503c\u4e0d\u80fd\u4e3a NULL\uff0c\u8981\u6539\u4e3a\u5176\u4ed6\u7684 default \u6216\u8005\u7a7a\u3002NULL \u975e\u5e38\u5f71\u54cd\u7d22\u5f15\u7684\u67e5\u8be2\u6548\u7387\u3002\n<\/p>\n<p>\n\t\u53cd\u590d\u67e5\u770b\u4e0e\u8868\u76f8\u5173\u7684 SQL\uff0c\u7b26\u5408\u6700\u5de6\u524d\u7f00\u7684\u7279\u70b9\u5efa\u7acb\u7d22\u5f15\u3002\u591a\u6761\u5b57\u6bb5\u91cd\u590d\u7684\u8bed\u53e5\uff0c\u8981\u4fee\u6539\u8bed\u53e5\u6761\u4ef6\u5b57\u6bb5\u7684\u987a\u5e8f\uff0c\u4e3a\u5176\u5efa\u7acb\u4e00\u6761\u8054\u5408\u7d22\u5f15\uff0c\u51cf\u5c11\u7d22\u5f15\u6570\u91cf<br \/>\n\t\u80fd\u4f7f\u7528\u552f\u4e00\u7d22\u5f15\u5c31\u8981\u4f7f\u7528\u552f\u4e00\u7d22\u5f15\uff0c\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002\n<\/p>\n<p>\n\t\u7814\u53d1\u8981\u7ecf\u5e38\u4f7f\u7528 explain\uff0c\u5982\u679c\u53d1\u73b0\u7d22\u5f15\u9009\u62e9\u6027\u5dee\uff0c\u5fc5\u987b\u8ba9\u4ed6\u4eec\u5b66\u4f1a\u4f7f\u7528 hint\u3002\n<\/p>\n<h2>\n\tSQL \u89c4\u8303<br \/>\n<\/h2>\n<ul>\n<li>\n\t\tsql \u8bed\u53e5\u5c3d\u53ef\u80fd\u7b80\u5355\uff0c\u5927\u7684 sql \u60f3\u529e\u6cd5\u62c6\u6210\u5c0f\u7684 sql \u8bed\u53e5(\u5145\u5206\u5229\u7528 QUERY CACHE \u548c\u5145\u5206\u5229\u7528\u591a\u6838 CPU)\n\t<\/li>\n<li>\n\t\t\u4e8b\u52a1\u8981\u7b80\u5355\uff0c\u6574\u4e2a\u4e8b\u52a1\u7684\u65f6\u95f4\u957f\u5ea6\u4e0d\u8981\u592a\u957f\n\t<\/li>\n<li>\n\t\t\u907f\u514d\u4f7f\u7528\u89e6\u53d1\u5668\u3001\u51fd\u6570\u3001\u5b58\u50a8\u8fc7\u7a0b\n\t<\/li>\n<li>\n\t\t\u964d\u4f4e\u4e1a\u52a1\u8026\u5408\u5ea6\uff0c\u4e3a sacle out\u3001sharding \u7559\u6709\u4f59\u5730\n\t<\/li>\n<li>\n\t\t\u907f\u514d\u5728\u6570\u636e\u5e93\u4e2d\u8fdb\u6570\u5b66\u8fd0\u7b97( MySQL \u4e0d\u64c5\u957f\u6570\u5b66\u8fd0\u7b97\u548c\u903b\u8f91\u5224\u65ad)\n\t<\/li>\n<li>\n\t\t\u4e0d\u8981\u7528 select *\uff0c\u67e5\u8be2\u54ea\u51e0\u4e2a\u5b57\u6bb5\u5c31 select \u8fd9\u51e0\u4e2a\u5b57\u6bb5\n\t<\/li>\n<li>\n\t\tsql \u4e2d\u4f7f\u7528\u5230 OR \u7684\u6539\u5199\u4e3a\u7528 IN() ( or \u7684\u6548\u7387\u6ca1\u6709 in \u7684\u6548\u7387\u9ad8)\n\t<\/li>\n<li>\n\t\tin\u91cc\u9762\u6570\u5b57\u7684\u4e2a\u6570\u5efa\u8bae\u63a7\u5236\u5728 1000 \u4ee5\u5185\n\t<\/li>\n<li>\n\t\tlimit \u5206\u9875\u6ce8\u610f\u6548\u7387\u3002Limit \u8d8a\u5927\uff0c\u6548\u7387\u8d8a\u4f4e\u3002\u53ef\u4ee5\u6539\u5199 limit\uff0c\u6bd4\u5982\u4f8b\u5b50\u6539\u5199\uff1aselect id from tlimit 10000, 10; &nbsp;=&gt; &nbsp;select id from t where id &gt; 10000 limit10;\n\t<\/li>\n<li>\n\t\t\u4f7f\u7528 union all \u66ff\u4ee3 union\n\t<\/li>\n<li>\n\t\t\u907f\u514d\u4f7f\u5927\u8868\u7684 JOIN\n\t<\/li>\n<li>\n\t\t\u4f7f\u7528 group by \u5206\u7ec4\u3001\u81ea\u52a8\u6392\u5e8f\n\t<\/li>\n<li>\n\t\t\u5bf9\u6570\u636e\u7684\u66f4\u65b0\u8981\u6253\u6563\u540e\u6279\u91cf\u66f4\u65b0\uff0c\u4e0d\u8981\u4e00\u6b21\u66f4\u65b0\u592a\u591a\u6570\u636e\n\t<\/li>\n<li>\n\t\t\u51cf\u5c11\u4e0e\u6570\u636e\u5e93\u7684\u4ea4\u4e92\u6b21\u6570\n\t<\/li>\n<li>\n\t\t\u6ce8\u610f\u4f7f\u7528\u6027\u80fd\u5206\u6790\u5de5\u5177 Sql explain\/showprofile\/mysqlsla\n\t<\/li>\n<li>\n\t\tSQL \u8bed\u53e5\u8981\u6c42\u6240\u6709\u7814\u53d1\uff0cSQL \u5173\u952e\u5b57\u5168\u90e8\u662f\u5927\u5199\uff0c\u6bcf\u4e2a\u8bcd\u53ea\u5141\u8bb8\u6709\u4e00\u4e2a\u7a7a\u683c\n\t<\/li>\n<li>\n\t\tSQL \u8bed\u53e5\u4e0d\u53ef\u4ee5\u51fa\u73b0\u9690\u5f0f\u8f6c\u6362\uff0c\u6bd4\u5982 select id from \u8868 where id=&#039;1&#039;\n\t<\/li>\n<li>\n\t\tIN \u6761\u4ef6\u91cc\u9762\u7684\u6570\u636e\u6570\u91cf\u8981\u5c11\uff0c\u6211\u8bb0\u5f97\u5e94\u8be5\u662f 500 \u4e2a\u4ee5\u5185\uff0c\u8981\u5b66\u4f1a\u4f7f\u7528 exist \u4ee3\u66ff in\uff0cexist \u5728\u4e00\u4e9b\u573a\u666f\u67e5\u8be2\u4f1a\u6bd4 in \u5feb\n\t<\/li>\n<li>\n\t\t\u80fd\u4e0d\u7528 NOT IN \u5c31\u4e0d\u7528 NOTIN\uff0c\u5751\u592a\u591a\u4e86\u3002\u3002\u4f1a\u628a\u7a7a\u548c NULL \u7ed9\u67e5\u51fa\u6765\n\t<\/li>\n<li>\n\t\t\u5728 SQL \u8bed\u53e5\u4e2d\uff0c\u7981\u6b62\u4f7f\u7528\u524d\u7f00\u662f % \u7684 like\n\t<\/li>\n<li>\n\t\t\u4e0d\u4f7f\u7528\u8d1f\u5411\u67e5\u8be2\uff0c\u5982 not in\/like\n\t<\/li>\n<li>\n\t\t\u5173\u4e8e\u5206\u9875\u67e5\u8be2\uff1a\u7a0b\u5e8f\u91cc\u5efa\u8bae\u5408\u7406\u4f7f\u7528\u5206\u9875\u6765\u63d0\u9ad8\u6548\u7387 limit\uff0coffset \u8f83\u5927\u8981\u914d\u5408\u5b50\u67e5\u8be2\u4f7f\u7528\n\t<\/li>\n<li>\n\t\t\u7981\u6b62\u5728\u6570\u636e\u5e93\u4e2d\u8dd1\u5927\u67e5\u8be2\n\t<\/li>\n<li>\n\t\t\u4f7f\u9884\u7f16\u8bd1\u8bed\u53e5\uff0c\u53ea\u4f20\u53c2\u6570\uff0c\u6bd4\u4f20\u9012 SQL \u8bed\u53e5\u66f4\u9ad8\u6548\uff1b\u4e00\u6b21\u89e3\u6790\uff0c\u591a\u6b21\u4f7f\u7528\uff1b\u964d\u4f4e SQL \u6ce8\u5165\u6982\u7387\n\t<\/li>\n<li>\n\t\t\u7981\u6b62\u4f7forder by rand()\n\t<\/li>\n<li>\n\t\t\u7981\u5355\u6761 SQL \u8bed\u53e5\u540c\u65f6\u66f4\u65b0\u591a\u4e2a\u8868\n\t<\/li>\n<\/ul>\n<h2>\n\t\u6d41\u7a0b\u89c4\u8303<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u6240\u6709\u7684\u5efa\u8868\u64cd\u4f5c\u9700\u8981\u63d0\u524d\u544a\u77e5\u8be5\u8868\u6d89\u53ca\u7684\u67e5\u8be2 sql\uff1b\n\t<\/li>\n<li>\n\t\t\u6240\u6709\u7684\u5efa\u8868\u9700\u8981\u786e\u5b9a\u5efa\u7acb\u54ea\u4e9b\u7d22\u5f15\u540e\u624d\u53ef\u4ee5\u5efa\u8868\u4e0a\u7ebf\uff1b\n\t<\/li>\n<li>\n\t\t\u6240\u6709\u7684\u6539\u8868\u7ed3\u6784\u3001\u52a0\u7d22\u5f15\u64cd\u4f5c\u90fd\u9700\u8981\u5c06\u6d89\u53ca\u5230\u6240\u6539\u8868\u7684\u67e5\u8be2 sql \u53d1\u51fa\u6765\u544a\u77e5 DBA \u7b49\u76f8\u5173\u4eba\u5458\uff1b\n\t<\/li>\n<li>\n\t\t\u5728\u5efa\u65b0\u8868\u52a0\u5b57\u6bb5\u4e4b\u524d\uff0c\u8981\u6c42\u7814\u53d1\u81f3\u5c11\u8981\u63d0\u524d 3 \u5929\u90ae\u4ef6\u51fa\u6765\uff0c\u7ed9 dba \u4eec\u8bc4\u4f30\u3001\u4f18\u5316\u548c\u5ba1\u6838\u7684\u65f6\u95f4\n\t<\/li>\n<li>\n\t\t\u6279\u91cf\u5bfc\u5165\u3001\u5bfc\u51fa\u6570\u636e\u5fc5\u987b\u63d0\u524d\u901a\u77e5 DBA \u534f\u52a9\u89c2\u5bdf\n\t<\/li>\n<li>\n\t\t\u7981\u5728\u7ebf\u4e0a\u4ece\u5e93\u6267\u884c\u540e\u53f0\u7ba1\u7406\u548c\u7edf\u8ba1\u7c7b\u67e5\u8be2\n\t<\/li>\n<li>\n\t\t\u7981\u6709 super \u6743\u9650\u7684\u5e94\u7528\u7a0b\u5e8f\u8d26\u53f7\u5b58\u5728\n\t<\/li>\n<li>\n\t\t\u63a8\u5e7f\u6d3b\u52a8\u6216\u4e0a\u7ebf\u65b0\u529f\u80fd\u5fc5\u987b\u63d0\u524d\u901a\u77e5 DBA \u8fdb\u884c\u6d41\u91cf\u8bc4\u4f30\n\t<\/li>\n<li>\n\t\t\u4e0d\u5728\u4e1a\u52a1\u9ad8\u5cf0\u671f\u6279\u91cf\u66f4\u65b0\u3001\u67e5\u8be2\u6570\u636e\u5e93\n\t<\/li>\n<\/ul>\n<h2>\n\t\u914d\u7f6e\u4f18\u5316\u89c4\u8303<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t\u5f00\u542f\u6162\u67e5\u8be2\uff0c\u7528\u4e8e sql \u8bed\u53e5\u5206\u6790\u3002\n\t<\/li>\n<li>\n\t\t\u5f00\u542f\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u7528\u4e8e\u9047\u5230 mysql \u5d29\u6e83\uff0c\u6570\u636e\u6062\u590d\n\t<\/li>\n<li>\n\t\tno-auto-rehash \u786e\u4fdd\u8fd9\u4e2a\u670d\u52a1\u542f\u52a8\u5f97\u6bd4\u8f83\u5feb\u3002\n\t<\/li>\n<li>\n\t\tback_log = 600\uff0c\u5728 MYSQL \u6682\u65f6\u505c\u6b62\u54cd\u5e94\u65b0\u8bf7\u6c42\u4e4b\u524d\uff0c\u77ed\u65f6\u95f4\u5185\u7684\u591a\u5c11\u4e2a\u8bf7\u6c42\u53ef\u4ee5\u88ab\u5b58\u5728\u5806\u6808\u4e2d\u3002\u5982\u679c\u7cfb\u7edf\u5728\u77ed\u65f6\u95f4\u5185\u6709\u5f88\u591a\u8fde\u63a5\uff0c\u5219\u9700\u8981\u589e\u5927\u8be5\u53c2\u6570\u7684\u503c\uff0c\u8be5\u53c2\u6570\u503c\u6307\u5b9a\u5230\u6765\u7684 TCP\/IP \u8fde\u63a5\u7684\u76d1\u542c\u961f\u5217\u7684\u5927\u5c0f\u3002\u9ed8\u8ba4\u503c 80\u3002\n\t<\/li>\n<li>\n\t\tmax_connections = 3000\uff0cMySQL \u5141\u8bb8\u6700\u5927\u7684\u8fdb\u7a0b\u8fde\u63a5\u6570\uff0c\u5982\u679c\u7ecf\u5e38\u51fa\u73b0 Too Many Connections \u7684\u9519\u8bef\u63d0\u793a\uff0c\u5219\u9700\u8981\u589e\u5927\u6b64\u503c\u3002\u9ed8\u8ba4 151\n\t<\/li>\n<li>\n\t\tmax_connect_errors = 6000\uff0c\u8bbe\u7f6e\u6bcf\u4e2a\u4e3b\u673a\u7684\u8fde\u63a5\u8bf7\u6c42\u5f02\u5e38\u4e2d\u65ad\u7684\u6700\u5927\u6b21\u6570\uff0c\u5f53\u8d85\u8fc7\u8be5\u6b21\u6570\uff0cMYSQL \u670d\u52a1\u5668\u5c06\u7981\u6b62 host \u7684\u8fde\u63a5\u8bf7\u6c42\uff0c\u76f4\u5230 mysql \u670d\u52a1\u5668\u91cd\u542f\u6216\u901a\u8fc7 flush hosts \u547d\u4ee4\u6e05\u7a7a\u6b64 host \u7684\u76f8\u5173\u4fe1\u606f\u3002\u9ed8\u8ba4 100\n\t<\/li>\n<li>\n\t\texternal-locking = FALSE\uff0c\u4f7f\u7528&ndash;skip-external-locking MySQL\u9009\u9879\u4ee5\u907f\u514d\u5916\u90e8\u9501\u5b9a\u3002\u8be5\u9009\u9879\u9ed8\u8ba4\u5f00\u542f\n\t<\/li>\n<li>\n\t\tmax_allowed_packet = 32M\uff0c\u8bbe\u7f6e\u5728\u7f51\u7edc\u4f20\u8f93\u4e2d\u4e00\u6b21\u6d88\u606f\u4f20\u8f93\u91cf\u7684\u6700\u5927\u503c\u3002\u7cfb\u7edf\u9ed8\u8ba4\u503c \u4e3a4MB\uff0c\u6700\u5927\u503c\u662f1GB\uff0c\u5fc5\u987b\u8bbe\u7f6e1024\u7684\u500d\u6570\u3002\n\t<\/li>\n<li>\n\t\tsort_buffer_size = 2M\uff0cSort_Buffer_Size \u662f\u4e00\u4e2a connection \u7ea7\u53c2\u6570\uff0c\u5728\u6bcf \u4e2aconnection\uff08session\uff09\u7b2c\u4e00\u6b21\u9700\u8981\u4f7f\u7528\u8fd9\u4e2a buffer \u7684\u65f6\u5019\uff0c\u4e00\u6b21\u6027\u5206\u914d\u8bbe\u7f6e\u7684\u5185\u5b58\u3002Sort_Buffer_Size \u5e76\u4e0d\u662f\u8d8a\u5927\u8d8a\u597d\uff0c\u7531\u4e8e\u662f connection \u7ea7\u7684\u53c2\u6570\uff0c\u8fc7\u5927\u7684\u8bbe\u7f6e+\u9ad8\u5e76\u53d1\u53ef\u80fd\u4f1a\u8017\u5c3d\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u3002\u4f8b\u5982\uff1a500\u4e2a\u8fde\u63a5\u5c06\u4f1a\u6d88\u8017 500*sort_buffer_size(8M)=4G \u5185\u5b58\uff0cSort_Buffer_Size \u8d85\u8fc7 2KB \u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u4f7f\u7528 mmap() \u800c\u4e0d\u662f malloc() \u6765\u8fdb\u884c\u5185\u5b58\u5206\u914d\uff0c\u5bfc\u81f4\u6548\u7387\u964d\u4f4e\u3002 \u7cfb\u7edf\u9ed8\u8ba4 2M\uff0c\u4f7f\u7528\u9ed8\u8ba4\u503c\u5373\u53ef\n\t<\/li>\n<li>\n\t\tjoin_buffer_size = 2M\uff0c\u7528\u4e8e\u8868\u95f4\u5173\u8054\u7f13\u5b58\u7684\u5927\u5c0f\uff0c\u548c sort_buffer_size \u4e00\u6837\uff0c\u8be5\u53c2\u6570\u5bf9\u5e94\u7684\u5206\u914d\u5185\u5b58\u4e5f\u662f\u6bcf\u4e2a\u8fde\u63a5\u72ec\u4eab\u3002\u7cfb\u7edf\u9ed8\u8ba4 2M\uff0c\u4f7f\u7528\u9ed8\u8ba4\u503c\u5373\u53ef\n\t<\/li>\n<li>\n\t\tthread_cache_size = 300\uff0c\u9ed8\u8ba4 38 \u670d\u52a1\u5668\u7ebf\u7a0b\u7f13\u5b58\u8fd9\u4e2a\u503c\u8868\u793a\u53ef\u4ee5\u91cd\u65b0\u5229\u7528\u4fdd\u5b58\u5728\u7f13\u5b58\u4e2d\u7ebf\u7a0b\u7684\u6570\u91cf,\u5f53\u65ad\u5f00\u8fde\u63a5\u65f6\u5982\u679c\u7f13\u5b58\u4e2d\u8fd8\u6709\u7a7a\u95f4,\u90a3\u4e48\u5ba2\u6237\u7aef\u7684\u7ebf\u7a0b\u5c06\u88ab\u653e\u5230\u7f13\u5b58\u4e2d,\u5982\u679c\u7ebf\u7a0b\u91cd\u65b0\u88ab\u8bf7\u6c42\uff0c\u90a3\u4e48\u8bf7\u6c42\u5c06\u4ece\u7f13\u5b58\u4e2d\u8bfb\u53d6,\u5982\u679c\u7f13\u5b58\u4e2d\u662f\u7a7a\u7684\u6216\u8005\u662f\u65b0\u7684\u8bf7\u6c42\uff0c\u90a3\u4e48\u8fd9\u4e2a\u7ebf\u7a0b\u5c06\u88ab\u91cd\u65b0\u521b\u5efa,\u5982\u679c\u6709\u5f88\u591a\u65b0\u7684\u7ebf\u7a0b\uff0c\u589e\u52a0\u8fd9\u4e2a\u503c\u53ef\u4ee5\u6539\u5584\u7cfb\u7edf\u6027\u80fd.\u901a\u8fc7\u6bd4\u8f83 Connections \u548c Threads_created \u72b6\u6001\u7684\u53d8\u91cf\uff0c\u53ef\u4ee5\u770b\u5230\u8fd9\u4e2a\u53d8\u91cf\u7684\u4f5c\u7528\u3002\u8bbe\u7f6e\u89c4\u5219\u5982\u4e0b\uff1a1GB \u5185\u5b58\u914d\u7f6e\u4e3a 8\uff0c2GB \u914d\u7f6e\u4e3a 16\uff0c3GB \u914d\u7f6e\u4e3a 32\uff0c4GB \u6216\u66f4\u9ad8\u5185\u5b58\uff0c\u53ef\u914d\u7f6e\u66f4\u5927\u3002\n\t<\/li>\n<li>\n\t\tthread_concurrency = 8\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u4e3a 10\uff0c\u4f7f\u7528 10 \u5148\u89c2\u5bdf ,\u8bbe\u7f6e thread_concurrency \u7684\u503c\u7684\u6b63\u786e\u4e0e\u5426, \u5bf9 mysql \u7684\u6027\u80fd\u5f71\u54cd\u5f88\u5927, \u5728\u591a\u4e2a cpu(\u6216\u591a\u6838)\u7684\u60c5\u51b5\u4e0b\uff0c\u9519\u8bef\u8bbe\u7f6e\u4e86\n\t<\/li>\n<li>\n\t\tthread_concurrency \u7684\u503c, \u4f1a\u5bfc\u81f4 mysql \u4e0d\u80fd\u5145\u5206\u5229\u7528\u591a cpu (\u6216\u591a\u6838), \u51fa\u73b0\u540c\u4e00\u65f6\u523b\u53ea\u80fd\u4e00\u4e2a cpu(\u6216\u6838)\u5728\u5de5\u4f5c\u7684\u60c5\u51b5\u3002thread_concurrency \u5e94\u8bbe\u4e3a CPU \u6838\u6570\u7684 2 \u500d\u3002\u6bd4\u5982\u6709\u4e00\u4e2a\u53cc\u6838\u7684 CPU, \u90a3\u4e48 thread_concurrency \u7684\u5e94\u8be5\u4e3a 4; 2 \u4e2a\u53cc\u6838\u7684 cpu, thread_concurrency \u7684\u503c\u5e94\u4e3a 8\u3002\n\t<\/li>\n<li>\n\t\tquery_cache_size = 64M\uff0c\u5728 MyISAM \u5f15\u64ce\u4f18\u5316\u4e2d\uff0c\u8fd9\u4e2a\u53c2\u6570\u4e5f\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u4f18\u5316\u53c2\u6570\u3002\u4f46\u4e5f\u7206\u9732\u51fa\u6765\u4e00\u4e9b\u95ee\u9898\u3002\u673a\u5668\u7684\u5185\u5b58\u8d8a\u6765\u8d8a\u5927\uff0c\u4e60\u60ef\u6027\u628a\u53c2\u6570\u5206\u914d\u7684\u503c\u8d8a\u6765\u8d8a\u5927\u3002\u8fd9\u4e2a\u53c2\u6570\u52a0\u5927\u540e\u4e5f\u5f15\u53d1\u4e86\u4e00\u7cfb\u5217\u95ee\u9898\u3002\u6211\u4eec\u9996\u5148\u5206\u6790\u4e00\u4e0b query_cache_size \u7684\u5de5\u4f5c\u539f\u7406\uff1a\u4e00\u4e2a SELECT \u67e5\u8be2\u5728 DB \u4e2d\u5de5\u4f5c\u540e\uff0cDB \u4f1a\u628a\u8be5\u8bed\u53e5\u7f13\u5b58\u4e0b\u6765\uff0c\u5f53\u540c\u6837\u7684\u4e00\u4e2a SQL \u518d\u6b21\u6765\u5230 DB\u91cc\u8c03\u7528\u65f6\uff0cDB\u5728\u8be5\u8868\u6ca1\u53d1\u751f\u53d8\u5316\u7684\u60c5\u51b5\u4e0b\u628a\u7ed3\u679c\u4ece\u7f13\u5b58\u4e2d\u8fd4\u56de\u7ed9Client\u3002\u8fd9\u91cc\u6709\u4e00\u4e2a\u5173\u5efa\u70b9\uff0c\u5c31\u662fDB\u5728\u5229\u7528Query_cache\u5de5\u4f5c\u65f6\uff0c\u8981\u6c42\u8be5\u8bed\u53e5\u6d89\u53ca\u7684\u8868\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u6ca1\u6709\u53d1\u751f\u53d8\u66f4\u3002\u90a3\u5982\u679c\u8be5\u8868\u5728\u53d1\u751f\u53d8\u66f4\u65f6\uff0cQuery_cache\u91cc\u7684\u6570\u636e\u53c8\u600e\u4e48\u5904\u7406\u5462\uff1f\u9996\u5148\u8981\u628aQuery_cache\u548c\u8be5\u8868\u76f8\u5173\u7684\u8bed\u53e5\u5168\u90e8\u7f6e\u4e3a\u5931\u6548\uff0c\u7136\u540e\u5728\u5199\u5165\u66f4\u65b0\u3002\u90a3\u4e48\u5982\u679cQuery_cache\u975e\u5e38\u5927\uff0c\u8be5\u8868\u7684\u67e5\u8be2\u7ed3\u6784\u53c8\u6bd4\u8f83\u591a\uff0c\u67e5\u8be2\u8bed\u53e5\u5931\u6548\u4e5f\u6162\uff0c\u4e00\u4e2a\u66f4\u65b0\u6216\u662fInsert\u5c31\u4f1a\u5f88\u6162\uff0c\u8fd9\u6837\u770b\u5230\u7684\u5c31\u662fUpdate\u6216\u662fInsert\u600e\u4e48\u8fd9\u4e48\u6162\u4e86\u3002\u6240\u4ee5\u5728\u6570\u636e\u5e93\u5199\u5165\u91cf\u6216\u662f\u66f4\u65b0\u91cf\u4e5f\u6bd4\u8f83\u5927\u7684\u7cfb\u7edf\uff0c\u8be5\u53c2\u6570\u4e0d\u9002\u5408\u5206\u914d\u8fc7\u5927\u3002\u800c\u4e14\u5728\u9ad8\u5e76\u53d1\uff0c\u5199\u5165\u91cf\u5927\u7684\u7cfb\u7edf\uff0c\u5efa\u8bae\u628a\u8be5\u529f\u80fd\u7981\u6389\u3002\n\t<\/li>\n<li>\n\t\tquery_cache_limit = 4M\uff0c\u6307\u5b9a\u5355\u4e2a\u67e5\u8be2\u80fd\u591f\u4f7f\u7528\u7684\u7f13\u51b2\u533a\u5927\u5c0f\uff0c\u7f3a\u7701\u4e3a1M\n\t<\/li>\n<li>\n\t\tquery_cache_min_res_unit = 2k &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u9ed8\u8ba4\u662f4KB\uff0c\u8bbe\u7f6e\u503c\u5927\u5bf9\u5927\u6570\u636e\u67e5\u8be2\u6709\u597d\u5904\uff0c\u4f46\u5982\u679c\u4f60\u7684\u67e5\u8be2\u90fd\u662f\u5c0f\u6570\u636e\u67e5\u8be2\uff0c\u5c31\u5bb9\u6613\u9020\u6210\u5185\u5b58\u788e\u7247\u548c\u6d6a\u8d39<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u67e5\u8be2\u7f13\u5b58\u788e\u7247\u7387 = Qcache_free_blocks \/ Qcache_total_blocks * 100%<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u5982\u679c\u67e5\u8be2\u7f13\u5b58\u788e\u7247\u7387\u8d85\u8fc720%\uff0c\u53ef\u4ee5\u7528FLUSH QUERY CACHE\u6574\u7406\u7f13\u5b58\u788e\u7247\uff0c\u6216\u8005\u8bd5\u8bd5\u51cf\u5c0fquery_cache_min_res_unit\uff0c\u5982\u679c\u4f60\u7684\u67e5\u8be2\u90fd\u662f\u5c0f\u6570\u636e\u91cf\u7684\u8bdd\u3002<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u67e5\u8be2\u7f13\u5b58\u5229\u7528\u7387 = (query_cache_size &ndash; Qcache_free_memory) \/ query_cache_size * 100%<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u67e5\u8be2\u7f13\u5b58\u5229\u7528\u7387\u572825%\u4ee5\u4e0b\u7684\u8bdd\u8bf4\u660equery_cache_size\u8bbe\u7f6e\u7684\u8fc7\u5927\uff0c\u53ef\u9002\u5f53\u51cf\u5c0f;\u67e5\u8be2\u7f13\u5b58\u5229\u7528\u7387\u572880%\u4ee5\u4e0a\u800c\u4e14Qcache_lowmem_prunes &gt; 50\u7684\u8bdd\u8bf4\u660equery_cache_size\u53ef\u80fd\u6709\u70b9\u5c0f\uff0c\u8981\u4e0d\u5c31\u662f\u788e\u7247\u592a\u591a\u3002<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u67e5\u8be2\u7f13\u5b58\u547d\u4e2d\u7387 = (Qcache_hits &ndash; Qcache_inserts) \/ Qcache_hits * 100%\n\t<\/li>\n<li>\n\t\tthread_stack = 192K &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u8bbe\u7f6eMYSQL\u6bcf\u4e2a\u7ebf\u7a0b\u7684\u5806\u6808\u5927\u5c0f\uff0c\u9ed8\u8ba4\u503c\u8db3\u591f\u5927\uff0c\u53ef\u6ee1\u8db3\u666e\u901a\u64cd\u4f5c\u3002\u53ef\u8bbe\u7f6e\u8303\u56f4\u4e3a128K\u81f34GB\uff0c\u9ed8\u8ba4\u4e3a256KB\uff0c\u4f7f\u7528\u9ed8\u8ba4\u89c2\u5bdf\n\t<\/li>\n<li>\n\t\ttransaction_isolation = READ-COMMITTED &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# \u8bbe\u5b9a\u9ed8\u8ba4\u7684\u4e8b\u52a1\u9694\u79bb\u7ea7\u522b.\u53ef\u7528\u7684\u7ea7\u522b\u5982\u4e0b:READ UNCOMMITTED-\u8bfb\u672a\u63d0\u4ea4 READ COMMITTE-\u8bfb\u5df2\u63d0\u4ea4 REPEATABLE READ -\u53ef\u91cd\u590d\u8bfb SERIALIZABLE -\u4e32\u884c\n\t<\/li>\n<li>\n\t\ttmp_table_size = 256M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# tmp_table_size \u7684\u9ed8\u8ba4\u5927\u5c0f\u662f 32M\u3002\u5982\u679c\u4e00\u5f20\u4e34\u65f6\u8868\u8d85\u51fa\u8be5\u5927\u5c0f\uff0cMySQL\u4ea7\u751f\u4e00\u4e2a The table tbl_name is full \u5f62\u5f0f\u7684\u9519\u8bef\uff0c\u5982\u679c\u4f60\u505a\u5f88\u591a\u9ad8\u7ea7 GROUP BY \u67e5\u8be2\uff0c\u589e\u52a0 tmp_table_size \u503c\u3002\u5982\u679c\u8d85\u8fc7\u8be5\u503c\uff0c\u5219\u4f1a\u5c06\u4e34\u65f6\u8868\u5199\u5165\u78c1\u76d8\u3002\n\t<\/li>\n<li>\n\t\tmax_heap_table_size = 256M\n\t<\/li>\n<li>\n\t\texpire_logs_days = 7 &nbsp;\n\t<\/li>\n<li>\n\t\tkey_buffer_size = 2048M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u6279\u5b9a\u7528\u4e8e\u7d22\u5f15\u7684\u7f13\u51b2\u533a\u5927\u5c0f\uff0c\u589e\u52a0\u5b83\u53ef\u4ee5\u5f97\u5230\u66f4\u597d\u7684\u7d22\u5f15\u5904\u7406\u6027\u80fd\uff0c\u5bf9\u4e8e\u5185\u5b58\u57284GB\u5de6\u53f3\u7684\u670d\u52a1\u5668\u6765\u8bf4\uff0c\u8be5\u53c2\u6570\u53ef\u8bbe\u7f6e\u4e3a256MB\u6216384MB\u3002\n\t<\/li>\n<li>\n\t\tread_buffer_size = 1M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u9ed8\u8ba4128K<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# MySql\u8bfb\u5165\u7f13\u51b2\u533a\u5927\u5c0f\u3002\u5bf9\u8868\u8fdb\u884c\u987a\u5e8f\u626b\u63cf\u7684\u8bf7\u6c42\u5c06\u5206\u914d\u4e00\u4e2a\u8bfb\u5165\u7f13\u51b2\u533a\uff0cMySql\u4f1a\u4e3a\u5b83\u5206\u914d\u4e00\u6bb5\u5185\u5b58\u7f13\u51b2\u533a\u3002read_buffer_size\u53d8\u91cf\u63a7\u5236\u8fd9\u4e00\u7f13\u51b2\u533a\u7684\u5927\u5c0f\u3002\u5982\u679c\u5bf9\u8868\u7684\u987a\u5e8f\u626b\u63cf\u8bf7\u6c42\u975e\u5e38\u9891\u7e41\uff0c\u5e76\u4e14\u4f60\u8ba4\u4e3a\u9891\u7e41\u626b\u63cf\u8fdb\u884c\u5f97\u592a\u6162\uff0c\u53ef\u4ee5\u901a\u8fc7\u589e\u52a0\u8be5\u53d8\u91cf\u503c\u4ee5\u53ca\u5185\u5b58\u7f13\u51b2\u533a\u5927\u5c0f\u63d0\u9ad8\u5176\u6027\u80fd\u3002\u548csort_buffer_size\u4e00\u6837\uff0c\u8be5\u53c2\u6570\u5bf9\u5e94\u7684\u5206\u914d\u5185\u5b58\u4e5f\u662f\u6bcf\u4e2a\u8fde\u63a5\u72ec\u4eab\u3002\n\t<\/li>\n<li>\n\t\tread_rnd_buffer_size = 16M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# MySql\u7684\u968f\u673a\u8bfb\uff08\u67e5\u8be2\u64cd\u4f5c\uff09\u7f13\u51b2\u533a\u5927\u5c0f\u3002\u5f53\u6309\u4efb\u610f\u987a\u5e8f\u8bfb\u53d6\u884c\u65f6(\u4f8b\u5982\uff0c\u6309\u7167\u6392\u5e8f\u987a\u5e8f)\uff0c\u5c06\u5206\u914d\u4e00\u4e2a\u968f\u673a\u8bfb\u7f13\u5b58\u533a\u3002\u8fdb\u884c\u6392\u5e8f\u67e5\u8be2\u65f6\uff0cMySql\u4f1a\u9996\u5148\u626b\u63cf\u4e00\u904d\u8be5\u7f13\u51b2\uff0c\u4ee5\u907f\u514d\u78c1\u76d8\u641c\u7d22\uff0c\u63d0\u9ad8\u67e5\u8be2\u901f\u5ea6\uff0c\u5982\u679c\u9700\u8981\u6392\u5e8f\u5927\u91cf\u6570\u636e\uff0c\u53ef\u9002\u5f53\u8c03\u9ad8\u8be5\u503c\u3002\u4f46MySql\u4f1a\u4e3a\u6bcf\u4e2a\u5ba2\u6237\u8fde\u63a5\u53d1\u653e\u8be5\u7f13\u51b2\u7a7a\u95f4\uff0c\u6240\u4ee5\u5e94\u5c3d\u91cf\u9002\u5f53\u8bbe\u7f6e\u8be5\u503c\uff0c\u4ee5\u907f\u514d\u5185\u5b58\u5f00\u9500\u8fc7\u5927\u3002\n\t<\/li>\n<li>\n\t\tbulk_insert_buffer_size = 64M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u6279\u91cf\u63d2\u5165\u6570\u636e\u7f13\u5b58\u5927\u5c0f\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u63d2\u5165\u6548\u7387\uff0c\u9ed8\u8ba4\u4e3a8M\n\t<\/li>\n<li>\n\t\tmyisam_sort_buffer_size = 128M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# MyISAM\u8868\u53d1\u751f\u53d8\u5316\u65f6\u91cd\u65b0\u6392\u5e8f\u6240\u9700\u7684\u7f13\u51b2 \u9ed8\u8ba48M\n\t<\/li>\n<li>\n\t\tmyisam_max_sort_file_size = 10G &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# MySQL\u91cd\u5efa\u7d22\u5f15\u65f6\u6240\u5141\u8bb8\u7684\u6700\u5927\u4e34\u65f6\u6587\u4ef6\u7684\u5927\u5c0f (\u5f53 REPAIR, ALTER TABLE \u6216\u8005 LOAD DATA INFILE).<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# \u5982\u679c\u6587\u4ef6\u5927\u5c0f\u6bd4\u6b64\u503c\u66f4\u5927,\u7d22\u5f15\u4f1a\u901a\u8fc7\u952e\u503c\u7f13\u51b2\u521b\u5efa(\u66f4\u6162)\n\t<\/li>\n<li>\n\t\tmyisam_max_extra_sort_file_size = 10G 5.6\u65e0\u6b64\u503c\u8bbe\u7f6e\n\t<\/li>\n<li>\n\t\tmyisam_repair_threads = 1 &nbsp; \u9ed8\u8ba4\u4e3a1<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# \u5982\u679c\u4e00\u4e2a\u8868\u62e5\u6709\u8d85\u8fc7\u4e00\u4e2a\u7d22\u5f15, MyISAM \u53ef\u4ee5\u901a\u8fc7\u5e76\u884c\u6392\u5e8f\u4f7f\u7528\u8d85\u8fc7\u4e00\u4e2a\u7ebf\u7a0b\u53bb\u4fee\u590d\u4ed6\u4eec.<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# \u8fd9\u5bf9\u4e8e\u62e5\u6709\u591a\u4e2aCPU\u4ee5\u53ca\u5927\u91cf\u5185\u5b58\u60c5\u51b5\u7684\u7528\u6237,\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9.\n\t<\/li>\n<li>\n\t\tinnodb_additional_mem_pool_size = 16M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u8bbe\u7f6e InnoDB \u5b58\u50a8\u7684\u6570\u636e\u76ee\u5f55\u4fe1\u606f\u548c\u5176\u5b83\u5185\u90e8\u6570\u636e\u7ed3\u6784\u7684\u5185\u5b58\u6c60\u5927\u5c0f\uff0c\u7c7b\u4f3c\u4e8eOracle\u7684library cache\u3002\u8fd9\u4e0d\u662f\u4e00\u4e2a\u5f3a\u5236\u53c2\u6570\uff0c\u53ef\u4ee5\u88ab\u7a81\u7834\u3002\n\t<\/li>\n<li>\n\t\tinnodb_buffer_pool_size = 2048M &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# \u8fd9\u5bf9Innodb\u8868\u6765\u8bf4\u975e\u5e38\u91cd\u8981\u3002Innodb\u76f8\u6bd4MyISAM\u8868\u5bf9\u7f13\u51b2\u66f4\u4e3a\u654f\u611f\u3002MyISAM\u53ef\u4ee5\u5728\u9ed8\u8ba4\u7684 key_buffer_size \u8bbe\u7f6e\u4e0b\u8fd0\u884c\u7684\u53ef\u4ee5\uff0c\u7136\u800cInnodb\u5728\u9ed8\u8ba4\u7684 innodb_buffer_pool_size \u8bbe\u7f6e\u4e0b\u5374\u8ddf\u8717\u725b\u4f3c\u7684\u3002\u7531\u4e8eInnodb\u628a\u6570\u636e\u548c\u7d22\u5f15\u90fd\u7f13\u5b58\u8d77\u6765\uff0c\u65e0\u9700\u7559\u7ed9\u64cd\u4f5c\u7cfb\u7edf\u592a\u591a\u7684\u5185\u5b58\uff0c\u56e0\u6b64\u5982\u679c\u53ea\u9700\u8981\u7528Innodb\u7684\u8bdd\u5219\u53ef\u4ee5\u8bbe\u7f6e\u5b83\u9ad8\u8fbe 70-80% \u7684\u53ef\u7528\u5185\u5b58\u3002\u4e00\u4e9b\u5e94\u7528\u4e8e key_buffer \u7684\u89c4\u5219\u6709 &mdash; \u5982\u679c\u4f60\u7684\u6570\u636e\u91cf\u4e0d\u5927\uff0c\u5e76\u4e14\u4e0d\u4f1a\u66b4\u589e\uff0c\u90a3\u4e48\u65e0\u9700\u628a innodb_buffer_pool_size \u8bbe\u7f6e\u7684\u592a\u5927\u4e86\n\t<\/li>\n<li>\n\t\t#innodb_data_file_path = ibdata1:1024M:autoextend \u8bbe\u7f6e\u8fc7\u5927\u5bfc\u81f4\u62a5\u9519\uff0c\u9ed8\u8ba412M\u89c2\u5bdf<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u8868\u7a7a\u95f4\u6587\u4ef6 \u91cd\u8981\u6570\u636e\n\t<\/li>\n<li>\n\t\t#innodb_file_io_threads = 4 &nbsp; \u4e0d\u660e\u786e\uff0c\u4f7f\u7528\u9ed8\u8ba4\u503c<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u6587\u4ef6IO\u7684\u7ebf\u7a0b\u6570\uff0c\u4e00\u822c\u4e3a 4\uff0c\u4f46\u662f\u5728 Windows \u4e0b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5f97\u8f83\u5927\u3002\n\t<\/li>\n<li>\n\t\tinnodb_thread_concurrency = 8 &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u670d\u52a1\u5668\u6709\u51e0\u4e2aCPU\u5c31\u8bbe\u7f6e\u4e3a\u51e0\uff0c\u5efa\u8bae\u7528\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u4e00\u822c\u4e3a8.\n\t<\/li>\n<li>\n\t\tinnodb_flush_log_at_trx_commit = 2 &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# \u5982\u679c\u5c06\u6b64\u53c2\u6570\u8bbe\u7f6e\u4e3a1\uff0c\u5c06\u5728\u6bcf\u6b21\u63d0\u4ea4\u4e8b\u52a1\u540e\u5c06\u65e5\u5fd7\u5199\u5165\u78c1\u76d8\u3002\u4e3a\u63d0\u4f9b\u6027\u80fd\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3a0\u62162\uff0c\u4f46\u8981\u627f\u62c5\u5728\u53d1\u751f\u6545\u969c\u65f6\u4e22\u5931\u6570\u636e\u7684\u98ce\u9669\u3002\u8bbe\u7f6e\u4e3a0\u8868\u793a\u4e8b\u52a1\u65e5\u5fd7\u5199\u5165\u65e5\u5fd7\u6587\u4ef6\uff0c\u800c\u65e5\u5fd7\u6587\u4ef6\u6bcf\u79d2\u5237\u65b0\u5230\u78c1\u76d8\u4e00\u6b21\u3002\u8bbe\u7f6e\u4e3a2\u8868\u793a\u4e8b\u52a1\u65e5\u5fd7\u5c06\u5728\u63d0\u4ea4\u65f6\u5199\u5165\u65e5\u5fd7\uff0c\u4f46\u65e5\u5fd7\u6587\u4ef6\u6bcf\u6b21\u5237\u65b0\u5230\u78c1\u76d8\u4e00\u6b21\u3002\n\t<\/li>\n<li>\n\t\t#innodb_log_buffer_size = 16M &nbsp; \u4f7f\u7528\u9ed8\u8ba48M<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u6b64\u53c2\u6570\u786e\u5b9a\u4e9b\u65e5\u5fd7\u6587\u4ef6\u6240\u7528\u7684\u5185\u5b58\u5927\u5c0f\uff0c\u4ee5M\u4e3a\u5355\u4f4d\u3002\u7f13\u51b2\u533a\u66f4\u5927\u80fd\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u610f\u5916\u7684\u6545\u969c\u5c06\u4f1a\u4e22\u5931\u6570\u636e.MySQL\u5f00\u53d1\u4eba\u5458\u5efa\u8bae\u8bbe\u7f6e\u4e3a1\uff0d8M\u4e4b\u95f4\n\t<\/li>\n<li>\n\t\t#innodb_log_file_size = 128M &nbsp;\u4f7f\u7528\u9ed8\u8ba448M<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u6b64\u53c2\u6570\u786e\u5b9a\u6570\u636e\u65e5\u5fd7\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4ee5M\u4e3a\u5355\u4f4d\uff0c\u66f4\u5927\u7684\u8bbe\u7f6e\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6062\u590d\u6545\u969c\u6570\u636e\u5e93\u6240\u9700\u7684\u65f6\u95f4\n\t<\/li>\n<li>\n\t\t#innodb_log_files_in_group = 3 &nbsp; \u4f7f\u7528\u9ed8\u8ba42<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u4e3a\u63d0\u9ad8\u6027\u80fd\uff0cMySQL\u53ef\u4ee5\u4ee5\u5faa\u73af\u65b9\u5f0f\u5c06\u65e5\u5fd7\u6587\u4ef6\u5199\u5230\u591a\u4e2a\u6587\u4ef6\u3002\u63a8\u8350\u8bbe\u7f6e\u4e3a3M\n\t<\/li>\n<li>\n\t\t#innodb_max_dirty_pages_pct = 90 &nbsp;\u4f7f\u7528\u9ed8\u8ba475\u89c2\u5bdf<br \/>\n\t\t&nbsp; &nbsp; &nbsp;# Buffer_Pool\u4e2dDirty_Page\u6240\u5360\u7684\u6570\u91cf\uff0c\u76f4\u63a5\u5f71\u54cdInnoDB\u7684\u5173\u95ed\u65f6\u95f4\u3002\u53c2\u6570innodb_max_dirty_pages_pct \u53ef\u4ee5\u76f4\u63a5\u63a7\u5236\u4e86Dirty_Page\u5728Buffer_Pool\u4e2d\u6240\u5360\u7684\u6bd4\u7387\uff0c\u800c\u4e14\u5e78\u8fd0\u7684\u662finnodb_max_dirty_pages_pct\u662f\u53ef\u4ee5\u52a8\u6001\u6539\u53d8\u7684\u3002\u6240\u4ee5\uff0c\u5728\u5173\u95edInnoDB\u4e4b\u524d\u5148\u5c06innodb_max_dirty_pages_pct\u8c03\u5c0f\uff0c\u5f3a\u5236\u6570\u636e\u5757Flush\u4e00\u6bb5\u65f6\u95f4\uff0c\u5219\u80fd\u591f\u5927\u5927\u7f29\u77ed MySQL\u5173\u95ed\u7684\u65f6\u95f4\u3002\n\t<\/li>\n<li>\n\t\tinnodb_lock_wait_timeout = 120 &nbsp;<br \/>\n\t\t&nbsp; &nbsp; &nbsp;#\u9ed8\u8ba4\u4e3a50\u79d2 InnoDB \u6709\u5176\u5185\u7f6e\u7684\u6b7b\u9501\u68c0\u6d4b\u673a\u5236\uff0c\u80fd\u5bfc\u81f4\u672a\u5b8c\u6210\u7684\u4e8b\u52a1\u56de\u6eda\u3002\u4f46\u662f\uff0c\u5982\u679c\u7ed3\u5408InnoDB\u4f7f\u7528MyISAM\u7684lock tables \u8bed\u53e5\u6216\u7b2c\u4e09\u65b9\u4e8b\u52a1\u5f15\u64ce,\u5219InnoDB\u65e0\u6cd5\u8bc6\u522b\u6b7b\u9501\u3002\u4e3a\u6d88\u9664\u8fd9\u79cd\u53ef\u80fd\u6027\uff0c\u53ef\u4ee5\u5c06innodb_lock_wait_timeout\u8bbe\u7f6e\u4e3a\u4e00\u4e2a\u6574\u6570\u503c\uff0c\u6307\u793a MySQL\u5728\u5141\u8bb8\u5176\u4ed6\u4e8b\u52a1\u4fee\u6539\u90a3\u4e9b\u6700\u7ec8\u53d7\u4e8b\u52a1\u56de\u6eda\u7684\u6570\u636e\u4e4b\u524d\u8981\u7b49\u5f85\u591a\u957f\u65f6\u95f4(\u79d2\u6570)\n\t<\/li>\n<li>\n\t\tinnodb_file_per_table = 0 &nbsp;<br \/>\n\t\t&nbsp; &nbsp; #\u9ed8\u8ba4\u4e3aNo #\u72ec\u4eab\u8868\u7a7a\u95f4\uff08\u5173\u95ed\uff09\n\t<\/li>\n<\/ul>\n<p>\n\t\u8fd9\u4e9b SQL \u89c4\u8303\uff0c\u4f18\u5316\u6765\u81ea\u65e5\u5e38\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u6700\u4f73\u5b9e\u8df5\u901a\u5e38\u662f\u4e3a\u4e86\u83b7\u53d6\u6700\u4f73\u6027\u80fd\uff0c\u4f46\u6709\u53ef\u80fd\u4e00\u4e2a\u652f\u4ed8\u73af\u5883\uff0c\u6bcf\u79d2\u53ea\u9700\u89813000\u4e2a\u4e8b\u52a1\u5c31\u591f\u4e86\uff0c\u66f4\u770b\u91cd\u4e00\u81f4\u6027\u3002\u6240\u4ee5\u5bf9\u4e8e\u6027\u80fd\uff0c\u5173\u5efa\u662f\u8981\u660e\u786e\u4e00\u4e0b\u5b9a\u4f4d\uff0c\u7136\u540e\u518d\u8ddf\u636e\u81ea\u5df2\u7684\u60c5\u51b5\u6765\u5224\u5230\u5e95\u4f7f\u7528\u90a3\u4e9b\u62db\u5f0f\u7ec4\u5408\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3582\">\u5206\u4eab\u4e00\u5957 MySQL \u8fd0\u7ef4\u53ca\u5f00\u53d1\u89c4\u8303<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5728\u53bb IOE \u7684\u8d8b\u52bf\u4e0b\uff0cMySQL \u8d8a\u6765\u8d8a\u6d41\u884c\u3002\u4f46\u662f MySQL \u5f00\u53d1\u89c4\u8303\uff0c\u8bbe\u8ba1\u89c4\u8303\u65b9\u9762\u7684\u6587\u6863\u4e00\u76f4\u4ee5\u6765\u90fd\u662f\u6bd4\u8f83 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1674,1675,83,394,430],"class_list":["post-3582","post","type-post","status-publish","format-standard","hentry","category-yyzt","tag-innodb","tag-myisam","tag-mysql","tag-394","tag-430"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3582"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3582\/revisions"}],"predecessor-version":[{"id":3583,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3582\/revisions\/3583"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}