{"id":6213,"date":"2024-11-14T11:53:22","date_gmt":"2024-11-14T03:53:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6213\/"},"modified":"2024-11-14T11:53:22","modified_gmt":"2024-11-14T03:53:22","slug":"%e5%a6%82%e4%bd%95%e5%88%a4%e6%96%admysql%e6%ad%a3%e5%b8%b8%e5%90%af%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6213\/","title":{"rendered":"\u5982\u4f55\u5224\u65admysql\u6b63\u5e38\u542f\u52a8"},"content":{"rendered":"<blockquote><p>\n  \u8981\u5224\u65ad mysql \u662f\u5426\u6b63\u5e38\u542f\u52a8\uff0c\u53ef\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\uff1a\u67e5\u770b error.log \u4e2d\u662f\u5426\u6709\u9519\u8bef\u6d88\u606f\u3002\u4f7f\u7528\u547d\u4ee4\u884c\uff1a\u4f7f\u7528 mysql \u547d\u4ee4\u5c1d\u8bd5\u8fde\u63a5\u5230 mysql\u3002\u4f7f\u7528 gui \u5ba2\u6237\u7aef\uff1a\u8fde\u63a5\u5230 mysql \u5e76\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001\u3002\u5176\u4ed6\u6307\u793a\u5668\uff1a\u7aef\u53e3\u76d1\u542c\u68c0\u67e5\u3001\u8fdb\u7a0b\u8fd0\u884c\u68c0\u67e5\u3002\u5982\u679c\u672a\u6b63\u5e38\u542f\u52a8\uff0c\u53ef\u68c0\u67e5 error.log\u3001\u8c03\u6574\u914d\u7f6e\u6587\u4ef6\u3001\u68c0\u67e5\u7aef\u53e3\u51b2\u7a81\u6216\u91cd\u65b0\u542f\u52a8 mysql\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/15\/2024061513454722403.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5224\u65admysql\u6b63\u5e38\u542f\u52a8\u63d2\u56fe\" alt=\"\u5982\u4f55\u5224\u65admysql\u6b63\u5e38\u542f\u52a8\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5224\u65ad MySQL \u6b63\u5e38\u542f\u52a8<\/strong><\/p>\n<p>\u4e3a\u4e86\u5224\u65ad MySQL \u662f\u5426\u6b63\u5e38\u542f\u52a8\uff0c\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\uff1a<\/strong><\/p>\n<ul>\n<li>Linux\/macOS\uff1a\u8fd0\u884c tail -f \/var\/log\/\/error.log \u5e76\u68c0\u67e5\u9519\u8bef\u6d88\u606f\u3002<\/li>\n<li>Windows\uff1a\u6253\u5f00 Windows \u4e8b\u4ef6\u67e5\u770b\u5668\uff0c\u5bfc\u822a\u5230\u201c\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u65e5\u5fd7\u201d&gt;\u201cMySQL\u201d\uff0c\u67e5\u770b\u9519\u8bef\u65e5\u5fd7\u3002<\/li>\n<\/ul>\n<p><strong>2. \u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff1a<\/strong><\/p>\n<ul>\n<li>\u8fd0\u884c mysql -u root -p\uff0c\u4f7f\u7528 root \u7528\u6237\u51ed\u636e\u8fde\u63a5\u5230 MySQL\u3002<\/li>\n<li>\u8f93\u5165\u5bc6\u7801\u540e\uff0c\u5982\u679c\u8fde\u63a5\u6210\u529f\uff0c\u5219 MySQL \u5df2\u6b63\u5e38\u542f\u52a8\u3002<\/li>\n<\/ul>\n<p><strong>3. \u901a\u8fc7 GUI \u68c0\u67e5\uff1a<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u60a8\u5df2\u5b89\u88c5 MySQL GUI \u5ba2\u6237\u7aef\uff0c\u8bf7\u5c06\u5176\u542f\u52a8\u3002<\/li>\n<li>\u8fde\u63a5\u5230 MySQL \u5e76\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001\u3002\u5982\u679c\u72b6\u6001\u4e3a\u201c\u8fd0\u884c\u201d\uff0c\u5219 MySQL \u5df2\u6b63\u5e38\u542f\u52a8\u3002<\/li>\n<\/ul>\n<p><strong>4. \u5176\u4ed6\u6307\u793a\u5668\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>\u7aef\u53e3\u76d1\u542c\uff1a<\/strong>MySQL \u901a\u5e38\u5728 3306 \u7aef\u53e3\u76d1\u542c\u3002\u4f7f\u7528 netstat -an \u547d\u4ee4\u68c0\u67e5\u8be5\u7aef\u53e3\u662f\u5426\u5df2\u6253\u5f00\u4e14 MySQL \u6b63\u5728\u76d1\u542c\u3002<\/li>\n<li> <strong>\u8fdb\u7a0b\u6b63\u5728\u8fd0\u884c\uff1a<\/strong>\u68c0\u67e5 MySQL \u8fdb\u7a0b\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002\u5728 Linux\/macOS \u4e2d\u4f7f\u7528 ps -ef | grep mysql\uff0c\u5728 Windows \u4e2d\u4f7f\u7528\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u5982\u679c MySQL \u672a\u6b63\u5e38\u542f\u52a8\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>\u68c0\u67e5 error.log\uff1a<\/strong>\u67e5\u627e\u9519\u8bef\u6d88\u606f\u4ee5\u8bc6\u522b\u5bfc\u81f4\u542f\u52a8\u5931\u8d25\u7684\u539f\u56e0\u3002<\/li>\n<li> <strong>\u8c03\u6574\u914d\u7f6e\u6587\u4ef6\uff1a<\/strong>MySQL \u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u4e3a my.cnf\uff09\u5305\u542b\u542f\u52a8\u53c2\u6570\u3002\u68c0\u67e5\u8be5\u6587\u4ef6\u662f\u5426\u6709\u4efb\u4f55\u9519\u8bef\u6216\u4e0d\u517c\u5bb9\u7684\u8bbe\u7f6e\u3002<\/li>\n<li> <strong>\u68c0\u67e5\u7aef\u53e3\u51b2\u7a81\uff1a<\/strong>\u786e\u4fdd MySQL \u6b63\u5728\u76d1\u542c\u6b63\u786e\u7684\u7aef\u53e3\uff0c\u5e76\u4e14\u6ca1\u6709\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u6b63\u5728\u4f7f\u7528\u8be5\u7aef\u53e3\u3002<\/li>\n<li> <strong>\u91cd\u65b0\u542f\u52a8 MySQL\uff1a<\/strong>\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8 MySQL \u670d\u52a1\u3002\u5728 Linux\/macOS \u4e2d\u4f7f\u7528 service mysql restart\uff0c\u5728 Windows \u4e2d\u4f7f\u7528\u201c\u670d\u52a1\u201d\u63a7\u5236\u9762\u677f\u3002<\/li>\n<li> <strong>\u8054\u7cfb MySQL \u652f\u6301\uff1a<\/strong>\u5982\u679c\u60a8\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u8bf7\u8054\u7cfb MySQL \u652f\u6301\u56e2\u961f\u4ee5\u83b7\u53d6\u5e2e\u52a9\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5224\u65ad\u6b63\u5e38\u542f\u52a8\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u5224\u65ad mysql \u662f\u5426\u6b63\u5e38\u542f\u52a8\uff0c\u53ef\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\uff1a\u67e5\u770b error.log \u4e2d\u662f\u5426\u6709\u9519\u8bef\u6d88\u606f\u3002\u4f7f\u7528\u547d\u4ee4\u884c\uff1a\u4f7f\u7528 mysql \u547d\u4ee4\u5c1d\u8bd5\u8fde\u63a5\u5230 mysql\u3002\u4f7f\u7528 gui \u5ba2\u6237\u7aef\uff1a\u8fde\u63a5\u5230 mysql \u5e76\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001\u3002\u5176\u4ed6\u6307\u793a\u5668\uff1a\u7aef\u53e3\u76d1\u542c\u68c0\u67e5\u3001\u8fdb\u7a0b\u8fd0\u884c\u68c0\u67e5\u3002\u5982\u679c\u672a\u6b63\u5e38\u542f\u52a8\uff0c\u53ef\u68c0\u67e5 error.log\u3001\u8c03\u6574\u914d\u7f6e\u6587\u4ef6\u3001\u68c0\u67e5\u7aef\u53e3\u51b2\u7a81\u6216\u91cd\u65b0\u542f\u52a8 mysql\u3002 \u5982\u4f55\u5224\u65ad MySQL \u6b63\u5e38\u542f\u52a8 \u4e3a\u4e86\u5224\u65ad MySQL \u662f\u5426\u6b63\u5e38\u542f\u52a8\uff0c\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\uff1a Linux\/macOS\uff1a\u8fd0\u884c tail -f \/var\/log\/\/error.log \u5e76\u68c0\u67e5\u9519\u8bef\u6d88\u606f\u3002 Windows\uff1a\u6253\u5f00 Windows \u4e8b\u4ef6\u67e5\u770b\u5668\uff0c\u5bfc\u822a\u5230\u201c\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u65e5\u5fd7\u201d&gt;\u201cMySQL\u201d\uff0c\u67e5\u770b\u9519\u8bef\u65e5\u5fd7\u3002 2. \u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff1a \u8fd0\u884c mysql -u root -p\uff0c\u4f7f\u7528 root \u7528\u6237\u51ed\u636e\u8fde\u63a5\u5230 MySQL\u3002 \u8f93\u5165\u5bc6\u7801\u540e\uff0c\u5982\u679c\u8fde\u63a5\u6210\u529f\uff0c\u5219 MySQL \u5df2\u6b63\u5e38\u542f\u52a8\u3002 3. \u901a\u8fc7 GUI \u68c0\u67e5\uff1a \u5982\u679c\u60a8\u5df2\u5b89\u88c5 MySQL GUI \u5ba2\u6237\u7aef\uff0c\u8bf7\u5c06\u5176\u542f\u52a8\u3002 \u8fde\u63a5\u5230 MySQL \u5e76\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001\u3002\u5982\u679c\u72b6\u6001\u4e3a\u201c\u8fd0\u884c\u201d\uff0c\u5219 MySQL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6213","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6213"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6213\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}