{"id":5506,"date":"2024-11-14T09:21:01","date_gmt":"2024-11-14T01:21:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5506\/"},"modified":"2024-11-14T09:21:01","modified_gmt":"2024-11-14T01:21:01","slug":"%e6%80%8e%e4%b9%88%e9%aa%8c%e8%af%81mysql%e6%98%af%e5%90%a6%e5%ae%89%e8%a3%85%e6%88%90%e5%8a%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5506\/","title":{"rendered":"\u600e\u4e48\u9a8c\u8bc1mysql\u662f\u5426\u5b89\u88c5\u6210\u529f"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u9a8c\u8bc1 mysql \u5b89\u88c5\u6210\u529f\uff1f\u4f7f\u7528\u547d\u4ee4\u884c\u754c\u9762\uff1a\u952e\u5165 mysql -u root -p\u3002\u67e5\u770b\u7c7b\u4f3c welcome to the mysql monitor \u7684\u54cd\u5e94\uff0c\u8868\u793a\u8fde\u63a5\u6210\u529f\u3002\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\uff1a\u67e5\u770b \u5e94\u7528\u7a0b\u5e8f\u4e8b\u4ef6\u65e5\u5fd7 \u6216 \/var\/log\/mysql.log \u4e2d\u7684 mysql \u4e8b\u4ef6\u3002\u68c0\u67e5 mysql \u670d\u52a1\uff1a\u5728 windows \u4e0a\uff0c\u67e5\u770b \u670d\u52a1 \u4e2d mysql \u670d\u52a1\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002\u5728 macos\/linux \u4e0a\uff0c\u8fd0\u884c sudo systemctl status mysql\uff0c\u67e5\u770b\u8f93\u51fa\u4e2d\u662f\u5426\u663e\u793a act\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/29\/2024052905212834476.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u9a8c\u8bc1mysql\u662f\u5426\u5b89\u88c5\u6210\u529f\u63d2\u56fe\" alt=\"\u600e\u4e48\u9a8c\u8bc1mysql\u662f\u5426\u5b89\u88c5\u6210\u529f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u9a8c\u8bc1 MySQL \u662f\u5426\u5b89\u88c5\u6210\u529f<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762<\/strong><\/p>\n<ul>\n<li>\u5728 Windows \u4e0a\uff1a\u6309\u4f4f Windows \u952e\u5e76\u6309 R \u952e\uff0c\u952e\u5165\u201ccmd\u201d\u5e76\u6309 Enter\u3002<\/li>\n<li>\u5728 macOS\/Linux \u4e0a\uff1a\u6253\u5f00\u7ec8\u7aef\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 2\uff1a\u8f93\u5165 MySQL \u547d\u4ee4<\/strong><\/p>\n<p>\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\uff0c\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysql -u root -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u66ff\u6362\u201croot\u201d\u4e3a\u60a8\u7684 MySQL \u6839\u7528\u6237\u540d\u3002<\/li>\n<li>\u66ff\u6362\u201cp\u201d\u4e3a\u60a8\u7684 MySQL \u6839\u5bc6\u7801\uff08\u5982\u679c\u672a\u8bbe\u7f6e\u5bc6\u7801\uff0c\u5219\u7559\u7a7a\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u68c0\u67e5\u54cd\u5e94<\/strong><\/p>\n<p>\u5982\u679c MySQL \u5df2\u6210\u529f\u5b89\u88c5\uff0c\u60a8\u5c06\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u5185\u5bb9\u7684\u54cd\u5e94\uff1a<\/p>\n<pre>Welcome to the MySQL monitor.  Commands end with ; or g.\nYour MySQL connection id is 1\nServer version: 8.0.29-0ubuntu0.20.04.1 (Ubuntu)<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u8868\u660e\u60a8\u5df2\u6210\u529f\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff0c\u5e76\u4e14 MySQL \u5df2\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5176\u4ed6\u9a8c\u8bc1\u65b9\u6cd5<\/strong><\/p>\n<p>\u9664\u4e86\u4f7f\u7528\u547d\u4ee4\u884c\u754c\u9762\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u9a8c\u8bc1 MySQL \u7684\u5b89\u88c5\uff1a<\/p>\n<ul>\n<li> <strong>\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\uff1a<\/strong>\u5728 Windows \u4e0a\uff0c\u67e5\u770b\u201c\u5e94\u7528\u7a0b\u5e8f\u4e8b\u4ef6\u65e5\u5fd7\u201d\u4e0b\u7684\u201cMySQL\u201d\u4e8b\u4ef6ID\u3002\u5728 macOS\/Linux \u4e0a\uff0c\u67e5\u770b\u201c\/var\/log\/.log\u201d\u3002\u6210\u529f\u5b89\u88c5\u5e94\u663e\u793a\u5728\u65e5\u5fd7\u4e2d\u3002<\/li>\n<li> <strong>\u68c0\u67e5 MySQL \u670d\u52a1\uff1a<\/strong>\u5728 Windows \u4e0a\uff0c\u6253\u5f00\u201c\u670d\u52a1\u201d\u5e76\u67e5\u627e\u201cMySQL\u201d\u670d\u52a1\u3002\u5982\u679c\u5df2\u5b89\u88c5 MySQL\uff0c\u8be5\u670d\u52a1\u5e94\u6b63\u5728\u8fd0\u884c\u3002\u5728 macOS\/Linux \u4e0a\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>sudo systemctl status mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c MySQL \u5df2\u5b89\u88c5\u5e76\u6b63\u5728\u8fd0\u884c\uff0c\u60a8\u5c06\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u5185\u5bb9\u7684\u8f93\u51fa\uff1a<\/p>\n<pre>\u25cf mysql.service - MySQL Community Server\n     Loaded: loaded (\/lib\/systemd\/system\/mysql.service; enabled; vendor preset: enabled)\n     Active: active (running) since Mon 2023-03-06 14:56:17 UTC; 4min ago<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\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>\u5982\u4f55\u9a8c\u8bc1 mysql \u5b89\u88c5\u6210\u529f\uff1f\u4f7f\u7528\u547d\u4ee4\u884c\u754c\u9762\uff1a\u952e\u5165 mysql -u root -p\u3002\u67e5\u770b\u7c7b\u4f3c welcome to the mysql monitor \u7684\u54cd\u5e94\uff0c\u8868\u793a\u8fde\u63a5\u6210\u529f\u3002\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\uff1a\u67e5\u770b \u5e94\u7528\u7a0b\u5e8f\u4e8b\u4ef6\u65e5\u5fd7 \u6216 \/var\/log\/mysql.log \u4e2d\u7684 mysql \u4e8b\u4ef6\u3002\u68c0\u67e5 mysql \u670d\u52a1\uff1a\u5728 windows \u4e0a\uff0c\u67e5\u770b \u670d\u52a1 \u4e2d mysql \u670d\u52a1\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002\u5728 macos\/linux \u4e0a\uff0c\u8fd0\u884c sudo systemctl status mysql\uff0c\u67e5\u770b\u8f93\u51fa\u4e2d\u662f\u5426\u663e\u793a act \u5982\u4f55\u9a8c\u8bc1 MySQL \u662f\u5426\u5b89\u88c5\u6210\u529f \u6b65\u9aa4 1\uff1a\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762 \u5728 Windows \u4e0a\uff1a\u6309\u4f4f Windows \u952e\u5e76\u6309 R \u952e\uff0c\u952e\u5165\u201ccmd\u201d\u5e76\u6309 Enter\u3002 \u5728 macOS\/Linux \u4e0a\uff1a\u6253\u5f00\u7ec8\u7aef\u3002 \u6b65\u9aa4 2\uff1a\u8f93\u5165 MySQL \u547d\u4ee4 \u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\uff0c\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a [&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-5506","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5506","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=5506"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5506\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}