{"id":5293,"date":"2024-11-14T11:27:37","date_gmt":"2024-11-14T03:27:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5293\/"},"modified":"2024-11-14T11:27:37","modified_gmt":"2024-11-14T03:27:37","slug":"mysql%e5%ae%a2%e6%88%b7%e7%ab%af%e6%80%8e%e4%b9%88%e7%99%bb%e5%bd%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5293\/","title":{"rendered":"mysql\u5ba2\u6237\u7aef\u600e\u4e48\u767b\u5f55"},"content":{"rendered":"<blockquote><p>\n  \u767b\u5f55 mysql \u5ba2\u6237\u7aef\u7684\u6b65\u9aa4\uff1a\u4f7f\u7528\u547d\u4ee4\uff1amysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] -h [\u670d\u52a1\u5668\u5730\u5740] \u8fde\u63a5\u670d\u52a1\u5668\u3002\u8f93\u5165\u5bc6\u7801\u4ee5\u63d0\u793a\u7b26\u3002\u5bc6\u7801\u6b63\u786e\u540e\u767b\u5f55 mysql \u5ba2\u6237\u7aef\u3002\u4f7f\u7528 use [\u6570\u636e\u5e93\u540d]; \u8fdb\u5165\u76ee\u6807\u6570\u636e\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/26\/2024052618392138089.jpg\" class=\"aligncenter\" title=\"mysql\u5ba2\u6237\u7aef\u600e\u4e48\u767b\u5f55\u63d2\u56fe\" alt=\"mysql\u5ba2\u6237\u7aef\u600e\u4e48\u767b\u5f55\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u767b\u5f55 MySQL \u5ba2\u6237\u7aef<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 MySQL \u6570\u636e\u5e93\u7cfb\u7edf\u65f6\uff0c\u9700\u8981\u4f7f\u7528 MySQL \u5ba2\u6237\u7aef\u767b\u5f55\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668\u624d\u80fd\u6267\u884c\u64cd\u4f5c\u3002\u767b\u5f55\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p><strong>1. \u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<p>\u4ee5\u4ee5\u4e0b\u683c\u5f0f\u8f93\u5165\u547d\u4ee4\uff1a<\/p>\n<pre>mysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] -h [\u670d\u52a1\u5668\u5730\u5740]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>-u \u6307\u5b9a\u7528\u6237\u540d<\/li>\n<li>-p \u6307\u5b9a\u5bc6\u7801<\/li>\n<li>-h \u6307\u5b9a\u670d\u52a1\u5668\u5730\u5740<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>mysql -u root -p -h localhost<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u8f93\u5165\u5bc6\u7801<\/strong><\/p>\n<p>\u5728\u63d0\u793a\u7b26\u4e0b\u8f93\u5165\u5bc6\u7801\uff0c\u7136\u540e\u6309 Enter \u952e\u3002<\/p>\n<p><strong>3. \u4f7f\u7528\u5bc6\u7801\u767b\u5f55<\/strong><\/p>\n<p>\u5982\u679c\u5bc6\u7801\u6b63\u786e\uff0c\u60a8\u5c06\u6210\u529f\u767b\u5f55\u5230 MySQL \u5ba2\u6237\u7aef\u3002<\/p>\n<p><strong>4. \u8fdb\u5165\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cMySQL \u5ba2\u6237\u7aef\u4f1a\u8fde\u63a5\u5230\u540d\u4e3a  \u7684\u6570\u636e\u5e93\u3002\u8981\u8fdb\u5165\u5176\u4ed6\u6570\u636e\u5e93\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>USE [\u6570\u636e\u5e93\u540d];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>USE my_database;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u5df2\u6210\u529f\u767b\u5f55\u5230 MySQL \u5ba2\u6237\u7aef\u5e76\u8fde\u63a5\u5230\u6307\u5b9a\u6570\u636e\u5e93\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5ba2\u6237\u7aef\u600e\u4e48\u767b\u5f55\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>\u767b\u5f55 mysql \u5ba2\u6237\u7aef\u7684\u6b65\u9aa4\uff1a\u4f7f\u7528\u547d\u4ee4\uff1amysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] -h [\u670d\u52a1\u5668\u5730\u5740] \u8fde\u63a5\u670d\u52a1\u5668\u3002\u8f93\u5165\u5bc6\u7801\u4ee5\u63d0\u793a\u7b26\u3002\u5bc6\u7801\u6b63\u786e\u540e\u767b\u5f55 mysql \u5ba2\u6237\u7aef\u3002\u4f7f\u7528 use [\u6570\u636e\u5e93\u540d]; \u8fdb\u5165\u76ee\u6807\u6570\u636e\u5e93\u3002 \u5982\u4f55\u767b\u5f55 MySQL \u5ba2\u6237\u7aef \u5728\u4f7f\u7528 MySQL \u6570\u636e\u5e93\u7cfb\u7edf\u65f6\uff0c\u9700\u8981\u4f7f\u7528 MySQL \u5ba2\u6237\u7aef\u767b\u5f55\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668\u624d\u80fd\u6267\u884c\u64cd\u4f5c\u3002\u767b\u5f55\u6b65\u9aa4\u5982\u4e0b\uff1a 1. \u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668 \u4ee5\u4ee5\u4e0b\u683c\u5f0f\u8f93\u5165\u547d\u4ee4\uff1a mysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] -h [\u670d\u52a1\u5668\u5730\u5740] \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff1a -u \u6307\u5b9a\u7528\u6237\u540d -p \u6307\u5b9a\u5bc6\u7801 -h \u6307\u5b9a\u670d\u52a1\u5668\u5730\u5740 \u4f8b\u5982\uff1a mysql -u root -p -h localhost \u767b\u5f55\u540e\u590d\u5236 2. \u8f93\u5165\u5bc6\u7801 \u5728\u63d0\u793a\u7b26\u4e0b\u8f93\u5165\u5bc6\u7801\uff0c\u7136\u540e\u6309 Enter [&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-5293","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5293","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=5293"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5293\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}