{"id":168275,"date":"2024-11-06T11:01:19","date_gmt":"2024-11-06T03:01:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/168275\/"},"modified":"2024-11-06T11:01:20","modified_gmt":"2024-11-06T03:01:20","slug":"%e6%b2%92%e9%81%87%e5%88%b0%e9%81%8e%e9%80%99%e5%8d%81%e5%80%8bmysql%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b6%93%e5%85%b8%e9%8c%af%e8%aa%a4%ef%bc%8c%e4%bd%a0%e4%b8%80%e5%ae%9a%e4%b8%8d%e6%98%af%e5%80%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/168275\/","title":{"rendered":"\u6c92\u9047\u5230\u904e\u9019\u5341\u500bMySQL\u6578\u64da\u5eab\u7d93\u5178\u932f\u8aa4\uff0c\u4f60\u4e00\u5b9a\u4e0d\u662f\u500b\u597d\u5de5\u7a0b\u5e2b"},"content":{"rendered":"<h1 id=\"%e6%b2%92%e9%81%87%e5%88%b0%e9%81%8e%e9%80%99%e5%8d%81%e5%80%8bmysql%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b6%93%e5%85%b8%e9%8c%af%e8%aa%a4%ef%bc%8c%e4%bd%a0%e4%b8%80%e5%ae%9a%e4%b8%8d%e6%98%af%e5%80%8b-bYcVyMCpGW\">\u6c92\u9047\u5230\u904e\u9019\u5341\u500bMySQL\u6578\u64da\u5eab\u7d93\u5178\u932f\u8aa4\uff0c\u4f60\u4e00\u5b9a\u4e0d\u662f\u500b\u597d\u5de5\u7a0b\u5e2b<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u7684\u4e16\u754c\u88e1\uff0cMySQL\u4f5c\u70ba\u4e00\u500b\u6d41\u884c\u7684\u958b\u6e90\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u7a2e\u61c9\u7528\u7a0b\u5e8f\u4e2d\u3002\u7121\u8ad6\u662f\u5c0f\u578b\u7db2\u7ad9\u9084\u662f\u5927\u578b\u4f01\u696d\u7cfb\u7d71\uff0cMySQL\u90fd\u626e\u6f14\u8457\u95dc\u9375\u89d2\u8272\u3002\u7136\u800c\uff0c\u5c0d\u65bc\u8a31\u591a\u5de5\u7a0b\u5e2b\u4f86\u8aaa\uff0c\u9762\u5c0dMySQL\u7684\u932f\u8aa4\u662f\u4e0d\u53ef\u907f\u514d\u7684\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5341\u500b\u7d93\u5178\u7684MySQL\u6578\u64da\u5eab\u932f\u8aa4\uff0c\u5e6b\u52a9\u5de5\u7a0b\u5e2b\u5011\u66f4\u597d\u5730\u7406\u89e3\u548c\u89e3\u6c7a\u9019\u4e9b\u554f\u984c\u3002<\/p>\n<h2 id=\"1-%e9%80%a3%e6%8e%a5%e6%95%b8%e9%87%8f%e8%b6%85%e9%81%8e%e9%99%90%e5%88%b6-bYcVyMCpGW\">1. \u9023\u63a5\u6578\u91cf\u8d85\u904e\u9650\u5236<\/h2>\n<p>MySQL\u7684\u9023\u63a5\u6578\u91cf\u662f\u6709\u9650\u5236\u7684\uff0c\u7576\u540c\u6642\u9023\u63a5\u7684\u5ba2\u6236\u7aef\u6578\u91cf\u8d85\u904e\u9019\u500b\u9650\u5236\u6642\uff0c\u6703\u51fa\u73fe\u932f\u8aa4\u3002\u9019\u901a\u5e38\u662f\u7531\u65bc\u61c9\u7528\u7a0b\u5e8f\u672a\u80fd\u6b63\u78ba\u95dc\u9589\u9023\u63a5\u6216\u9ad8\u6d41\u91cf\u5c0e\u81f4\u7684\u3002<\/p>\n<pre><code>ERROR 1040 (08004): Too many connections<\/code><\/pre>\n<h2 id=\"2-%e6%9f%a5%e8%a9%a2%e8%b6%85%e6%99%82-bYcVyMCpGW\">2. \u67e5\u8a62\u8d85\u6642<\/h2>\n<p>\u7576\u67e5\u8a62\u57f7\u884c\u6642\u9593\u904e\u9577\u6642\uff0cMySQL\u53ef\u80fd\u6703\u81ea\u52d5\u7d42\u6b62\u8a72\u67e5\u8a62\uff0c\u9019\u6703\u5c0e\u81f4\u932f\u8aa4\u3002\u9019\u901a\u5e38\u662f\u7531\u65bc\u67e5\u8a62\u672a\u7d93\u512a\u5316\u6216\u6578\u64da\u91cf\u904e\u5927\u6240\u81f4\u3002<\/p>\n<pre><code>ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction<\/code><\/pre>\n<h2 id=\"3-%e9%8c%af%e8%aa%a4%e7%9a%84sql%e8%aa%9e%e6%b3%95-bYcVyMCpGW\">3. \u932f\u8aa4\u7684SQL\u8a9e\u6cd5<\/h2>\n<p>SQL\u8a9e\u6cd5\u932f\u8aa4\u662f\u6700\u5e38\u898b\u7684\u932f\u8aa4\u4e4b\u4e00\u3002\u9019\u53ef\u80fd\u662f\u7531\u65bc\u62fc\u5beb\u932f\u8aa4\u3001\u7f3a\u5c11\u95dc\u9375\u5b57\u6216\u4e0d\u6b63\u78ba\u7684\u8a9e\u6cd5\u7d50\u69cb\u9020\u6210\u7684\u3002<\/p>\n<pre><code>ERROR 1064 (42000): You have an error in your SQL syntax<\/code><\/pre>\n<h2 id=\"4-%e5%a4%96%e9%8d%b5%e7%b4%84%e6%9d%9f%e5%a4%b1%e6%95%97-bYcVyMCpGW\">4. \u5916\u9375\u7d04\u675f\u5931\u6557<\/h2>\n<p>\u5728\u4f7f\u7528\u5916\u9375\u6642\uff0c\u5982\u679c\u63d2\u5165\u6216\u66f4\u65b0\u7684\u6578\u64da\u4e0d\u7b26\u5408\u5916\u9375\u7d04\u675f\uff0c\u5247\u6703\u51fa\u73fe\u932f\u8aa4\u3002\u9019\u901a\u5e38\u662f\u7531\u65bc\u6578\u64da\u4e0d\u4e00\u81f4\u6216\u672a\u6b63\u78ba\u8a2d\u7f6e\u5916\u9375\u9020\u6210\u7684\u3002<\/p>\n<pre><code>ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails<\/code><\/pre>\n<h2 id=\"5-%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b%e4%b8%8d%e5%8c%b9%e9%85%8d-bYcVyMCpGW\">5. \u6578\u64da\u985e\u578b\u4e0d\u5339\u914d<\/h2>\n<p>\u7576\u63d2\u5165\u6216\u66f4\u65b0\u6578\u64da\u6642\uff0c\u5982\u679c\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\uff0cMySQL\u6703\u5831\u932f\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u5c07\u5b57\u7b26\u4e32\u63d2\u5165\u6574\u6578\u5217\u6216\u65e5\u671f\u683c\u5f0f\u4e0d\u6b63\u78ba\u7684\u60c5\u6cc1\u4e0b\u3002<\/p>\n<pre><code>ERROR 1366 (HY000): Incorrect integer value: 'abc' for column 'id' at row 1<\/code><\/pre>\n<h2 id=\"6-%e8%b3%87%e6%96%99%e5%ba%ab%e4%b8%8d%e5%ad%98%e5%9c%a8-bYcVyMCpGW\">6. \u8cc7\u6599\u5eab\u4e0d\u5b58\u5728<\/h2>\n<p>\u7576\u5617\u8a66\u8a2a\u554f\u4e00\u500b\u4e0d\u5b58\u5728\u7684\u8cc7\u6599\u5eab\u6642\uff0c\u6703\u51fa\u73fe\u932f\u8aa4\u3002\u9019\u53ef\u80fd\u662f\u56e0\u70ba\u8cc7\u6599\u5eab\u540d\u7a31\u62fc\u5beb\u932f\u8aa4\u6216\u8cc7\u6599\u5eab\u5c1a\u672a\u5275\u5efa\u3002<\/p>\n<pre><code>ERROR 1049 (42000): Unknown database 'nonexistent_db'<\/code><\/pre>\n<h2 id=\"7-%e6%ac%8a%e9%99%90%e4%b8%8d%e8%b6%b3-bYcVyMCpGW\">7. \u6b0a\u9650\u4e0d\u8db3<\/h2>\n<p>\u5982\u679c\u7528\u6236\u6c92\u6709\u8db3\u5920\u7684\u6b0a\u9650\u4f86\u57f7\u884c\u67d0\u500b\u64cd\u4f5c\uff0cMySQL\u6703\u8fd4\u56de\u6b0a\u9650\u932f\u8aa4\u3002\u9019\u901a\u5e38\u662f\u7531\u65bc\u7528\u6236\u89d2\u8272\u8a2d\u7f6e\u4e0d\u7576\u9020\u6210\u7684\u3002<\/p>\n<pre><code>ERROR 1044 (42000): Access denied for user 'user'@'host' to database 'db'<\/code><\/pre>\n<h2 id=\"8-%e9%87%8d%e8%a4%87%e7%9a%84%e4%b8%bb%e9%8d%b5-bYcVyMCpGW\">8. \u91cd\u8907\u7684\u4e3b\u9375<\/h2>\n<p>\u5728\u63d2\u5165\u6578\u64da\u6642\uff0c\u5982\u679c\u4e3b\u9375\u503c\u5df2\u5b58\u5728\uff0c\u5247\u6703\u51fa\u73fe\u932f\u8aa4\u3002\u9019\u901a\u5e38\u662f\u7531\u65bc\u6578\u64da\u91cd\u8907\u6216\u672a\u6b63\u78ba\u8655\u7406\u4e3b\u9375\u751f\u6210\u908f\u8f2f\u9020\u6210\u7684\u3002<\/p>\n<pre><code>ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'<\/code><\/pre>\n<h2 id=\"9-%e4%ba%8b%e5%8b%99%e8%a1%9d%e7%aa%81-bYcVyMCpGW\">9. \u4e8b\u52d9\u885d\u7a81<\/h2>\n<p>\u5728\u4f7f\u7528\u4e8b\u52d9\u6642\uff0c\u5982\u679c\u5169\u500b\u4e8b\u52d9\u540c\u6642\u5617\u8a66\u4fee\u6539\u76f8\u540c\u7684\u6578\u64da\uff0c\u53ef\u80fd\u6703\u5c0e\u81f4\u885d\u7a81\u932f\u8aa4\u3002\u9019\u901a\u5e38\u9700\u8981\u901a\u904e\u9069\u7576\u7684\u9396\u5b9a\u6a5f\u5236\u4f86\u89e3\u6c7a\u3002<\/p>\n<pre><code>ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction<\/code><\/pre>\n<h2 id=\"10-%e7%a3%81%e7%a2%9f%e7%a9%ba%e9%96%93%e4%b8%8d%e8%b6%b3-bYcVyMCpGW\">10. \u78c1\u789f\u7a7a\u9593\u4e0d\u8db3<\/h2>\n<p>\u7576MySQL\u4f3a\u670d\u5668\u7684\u78c1\u789f\u7a7a\u9593\u4e0d\u8db3\u6642\uff0c\u5c07\u7121\u6cd5\u5beb\u5165\u6578\u64da\uff0c\u9019\u6703\u5c0e\u81f4\u932f\u8aa4\u3002\u5b9a\u671f\u6aa2\u67e5\u78c1\u789f\u7a7a\u9593\u4e26\u6e05\u7406\u4e0d\u5fc5\u8981\u7684\u6578\u64da\u662f\u5fc5\u8981\u7684\u3002<\/p>\n<pre><code>ERROR 28 (NO_SPACE): Out of disk space<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-bYcVyMCpGW\">\u7e3d\u7d50<\/h2>\n<p>\u4ee5\u4e0a\u4ecb\u7d39\u7684\u5341\u500bMySQL\u6578\u64da\u5eab\u7d93\u5178\u932f\u8aa4\u662f\u6bcf\u4f4d\u5de5\u7a0b\u5e2b\u5728\u5de5\u4f5c\u4e2d\u53ef\u80fd\u6703\u9047\u5230\u7684\u6311\u6230\u3002\u4e86\u89e3\u9019\u4e9b\u932f\u8aa4\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\uff0c\u4e0d\u50c5\u80fd\u63d0\u9ad8\u5de5\u7a0b\u5e2b\u7684\u6280\u8853\u6c34\u5e73\uff0c\u9084\u80fd\u5e6b\u52a9\u4ed6\u5011\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u66f4\u6709\u6548\u5730\u6392\u9664\u6545\u969c\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u6578\u64da\u5eab\u652f\u6301\u7684\u7528\u6236\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u65b9\u6848\u81f3\u95dc\u91cd\u8981\u3002\u7121\u8ad6\u662f <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\u60a8\u7684\u61c9\u7528\u63d0\u4f9b\u5f37\u5927\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u5341\u500b\u7d93\u5178\u7684MySQL\u6578\u64da\u5eab\u932f\u8aa4\uff0c\u4e86\u89e3\u5982\u4f55\u907f\u514d\u9019\u4e9b\u5e38\u898b\u9677\u9631\uff0c\u63d0\u5347\u4f60\u7684\u5de5\u7a0b\u5e2b\u6280\u80fd\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-168275","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168275","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=168275"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168275\/revisions"}],"predecessor-version":[{"id":168276,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168275\/revisions\/168276"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=168275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=168275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=168275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}