{"id":6380,"date":"2024-11-14T13:44:42","date_gmt":"2024-11-14T05:44:42","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6380\/"},"modified":"2024-11-14T13:44:42","modified_gmt":"2024-11-14T05:44:42","slug":"%e6%80%8e%e4%b9%88%e7%a1%ae%e5%ae%9amysql%e5%ae%89%e8%a3%85%e6%88%90%e5%8a%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6380\/","title":{"rendered":"\u600e\u4e48\u786e\u5b9amysql\u5b89\u88c5\u6210\u529f"},"content":{"rendered":"<blockquote><p>\n  \u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u9a8c\u8bc1 mysql \u5b89\u88c5\u6210\u529f\uff1a\u8fde\u63a5 mysql \u670d\u52a1\u5668\u5e76\u8f93\u5165 root \u5bc6\u7801\u3002\u6267\u884c select version() \u67e5\u8be2\u4ee5\u67e5\u770b\u670d\u52a1\u5668\u7248\u672c\u3002\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u663e\u793a mysql \u7248\u672c\u53f7\u3002\u901a\u8fc7 sudo systemctl status mysql \u547d\u4ee4\u68c0\u67e5\u670d\u52a1\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002\u4f7f\u7528 mysql \u5ba2\u6237\u5de5\u5177\u5c1d\u8bd5\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u5982\u679c\u4ee5\u4e0a\u6b65\u9aa4\u90fd\u6210\u529f\uff0c\u5219 mysql \u5df2\u6210\u529f\u5b89\u88c5\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/01\/2024080106191727493.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u786e\u5b9amysql\u5b89\u88c5\u6210\u529f\u63d2\u56fe\" alt=\"\u600e\u4e48\u786e\u5b9amysql\u5b89\u88c5\u6210\u529f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u786e\u5b9a MySQL \u5b89\u88c5\u6210\u529f<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u8fde\u63a5 MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u5e76\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysql -u root -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7cfb\u7edf\u63d0\u793a\u60a8\u8f93\u5165 MySQL \u7684 root \u5bc6\u7801\u3002\u5982\u679c\u6210\u529f\u8fde\u63a5\uff0c\u60a8\u5c06\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u8f93\u51fa\uff1a<\/p>\n<pre>Enter password:\nWelcome to the MySQL monitor.  Commands end with ; or g.\nYour MySQL connection id is 1\nServer version: 8.0.27-0ubuntu0.20.04.1 (Ubuntu)<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u6267\u884c\u67e5\u8be2<\/strong><\/p>\n<p>\u5728 MySQL \u63d0\u793a\u7b26\u5904\uff0c\u6267\u884c\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre>SELECT version();<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de MySQL \u670d\u52a1\u5668\u7684\u7248\u672c\u3002<\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u68c0\u67e5\u8f93\u51fa<\/strong><\/p>\n<p>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u67e5\u8be2\u5c06\u8fd4\u56de MySQL \u670d\u52a1\u5668\u7684\u7248\u672c\u53f7\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>mysql Ver 15.1 Distrib 10.4.23, for Linux (x86_64) using EditLine wrapper<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5176\u4ed6\u9a8c\u8bc1\u65b9\u6cd5<\/strong><\/p>\n<ul>\n<li> <strong>\u68c0\u67e5\u670d\u52a1\u662f\u5426\u6b63\u5728\u8fd0\u884c\uff1a<\/strong>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u6267\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<ul>\n<li> <strong>\u4f7f\u7528 MySQL \u5ba2\u6237\u5de5\u5177\uff1a<\/strong>\u6253\u5f00 MySQL Workbench \u6216\u5176\u4ed6 MySQL \u5ba2\u6237\u5de5\u5177\uff0c\u5e76\u5c1d\u8bd5\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4ee5\u4e0a\u6240\u6709\u65b9\u6cd5\u90fd\u6210\u529f\uff0c\u5219\u8868\u793a MySQL \u5df2\u6210\u529f\u5b89\u88c5\u5728\u60a8\u7684\u7cfb\u7edf\u4e0a\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u786e\u5b9a\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>\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u9a8c\u8bc1 mysql \u5b89\u88c5\u6210\u529f\uff1a\u8fde\u63a5 mysql \u670d\u52a1\u5668\u5e76\u8f93\u5165 root \u5bc6\u7801\u3002\u6267\u884c select version() \u67e5\u8be2\u4ee5\u67e5\u770b\u670d\u52a1\u5668\u7248\u672c\u3002\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u663e\u793a mysql \u7248\u672c\u53f7\u3002\u901a\u8fc7 sudo systemctl status mysql \u547d\u4ee4\u68c0\u67e5\u670d\u52a1\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002\u4f7f\u7528 mysql \u5ba2\u6237\u5de5\u5177\u5c1d\u8bd5\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u5982\u679c\u4ee5\u4e0a\u6b65\u9aa4\u90fd\u6210\u529f\uff0c\u5219 mysql \u5df2\u6210\u529f\u5b89\u88c5\u3002 \u5982\u4f55\u786e\u5b9a MySQL \u5b89\u88c5\u6210\u529f \u6b65\u9aa4 1\uff1a\u8fde\u63a5 MySQL \u670d\u52a1\u5668 \u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u5e76\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a mysql -u root -p \u767b\u5f55\u540e\u590d\u5236 \u7cfb\u7edf\u63d0\u793a\u60a8\u8f93\u5165 MySQL \u7684 root \u5bc6\u7801\u3002\u5982\u679c\u6210\u529f\u8fde\u63a5\uff0c\u60a8\u5c06\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u8f93\u51fa\uff1a Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection [&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-6380","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6380","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=6380"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6380\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}