{"id":6444,"date":"2024-11-14T11:14:14","date_gmt":"2024-11-14T03:14:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6444\/"},"modified":"2024-11-14T11:14:14","modified_gmt":"2024-11-14T03:14:14","slug":"%e6%80%8e%e4%b9%88%e5%90%af%e5%8a%a8mysql%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6444\/","title":{"rendered":"\u600e\u4e48\u542f\u52a8mysql\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u542f\u52a8 mysql \u6570\u636e\u5e93\uff1f\u786e\u8ba4 mysql \u5df2\u5b89\u88c5\uff1a\u8fd0\u884c &#8220;mysqld -v&#8221; \u547d\u4ee4\u68c0\u67e5\u7248\u672c\u4fe1\u606f\u3002\u542f\u52a8 mysql \u670d\u52a1\uff1a\u5728 linux\/macos \u4e0a\u4f7f\u7528 &#8220;sudo systemctl start mysql&#8221;\uff0c\u5728 windows \u4e0a\u4f7f\u7528 &#8220;net start mysql&#8221;\u3002\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff1a\u8f93\u5165 &#8220;mysql -u root -p&#8221; \u5e76\u8f93\u5165 root \u5bc6\u7801\u3002\u542f\u52a8\u6570\u636e\u5e93\uff1a\u8f93\u5165 &#8220;start database database_name;&#8221;\uff0c\u5c06 &#8220;database_name&#8221; \u66ff\u6362\u4e3a\u8981\u542f\u52a8\u7684\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080507275614151.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u542f\u52a8mysql\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"\u600e\u4e48\u542f\u52a8mysql\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u542f\u52a8 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p><strong>\u542f\u52a8 MySQL \u6570\u636e\u5e93\u7684\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u786e\u8ba4 MySQL \u670d\u52a1\u662f\u5426\u5df2\u5b89\u88c5<\/strong><\/p>\n<ul>\n<li>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165 &#8220;d -V&#8221; \u547d\u4ee4\u3002<\/li>\n<li>\u5982\u679c\u51fa\u73b0\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8868\u793a MySQL \u5df2\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8 MySQL \u670d\u52a1<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li> <strong>Linux\/macOS\uff1a<\/strong> sudo systemctl start mysql<\/li>\n<li> <strong>Windows\uff1a<\/strong> net start mysql<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>mysql -u root -p<\/li>\n<\/ul>\n<\/li>\n<li>\u8f93\u5165 MySQL root \u7528\u6237\u7684\u5bc6\u7801\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728 MySQL \u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>START DATABASE database_name;<\/li>\n<\/ul>\n<\/li>\n<li>\u5c06 &#8220;database_name&#8221; \u66ff\u6362\u4e3a\u8981\u542f\u52a8\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>\u5176\u4ed6\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u62e5\u6709\u4ee5 root \u7528\u6237\u542f\u52a8 MySQL \u670d\u52a1\u6240\u9700\u7684\u6743\u9650\u3002<\/li>\n<li>\u5982\u679c\u542f\u52a8\u670d\u52a1\u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u68c0\u67e5 MySQL \u914d\u7f6e\u6587\u4ef6 (\/etc\/my.cnf \u6216 C:ProgramDataMySQLMySQL Server 8.0my.ini) \u4e2d\u7684\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002<\/li>\n<li>\u5982\u679c\u6570\u636e\u5e93\u4e0d\u81ea\u52a8\u542f\u52a8\uff0c\u5219\u9700\u8981\u5728 MySQL \u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6e &#8220;autostart&#8221; \u8bbe\u7f6e\u3002<\/li>\n<li>\u5728\u542f\u52a8\u6570\u636e\u5e93\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u5df2\u521b\u5efa\u6240\u9700\u7684\u7528\u6237\u548c\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u542f\u52a8\u6570\u636e\u5e93\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\u542f\u52a8 mysql \u6570\u636e\u5e93\uff1f\u786e\u8ba4 mysql \u5df2\u5b89\u88c5\uff1a\u8fd0\u884c &#8220;mysqld -v&#8221; \u547d\u4ee4\u68c0\u67e5\u7248\u672c\u4fe1\u606f\u3002\u542f\u52a8 mysql \u670d\u52a1\uff1a\u5728 linux\/macos \u4e0a\u4f7f\u7528 &#8220;sudo systemctl start mysql&#8221;\uff0c\u5728 windows \u4e0a\u4f7f\u7528 &#8220;net start mysql&#8221;\u3002\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff1a\u8f93\u5165 &#8220;mysql -u root -p&#8221; \u5e76\u8f93\u5165 root \u5bc6\u7801\u3002\u542f\u52a8\u6570\u636e\u5e93\uff1a\u8f93\u5165 &#8220;start database database_name;&#8221;\uff0c\u5c06 &#8220;database_name&#8221; \u66ff\u6362\u4e3a\u8981\u542f\u52a8\u7684 \u5982\u4f55\u542f\u52a8 MySQL \u6570\u636e\u5e93 \u542f\u52a8 MySQL \u6570\u636e\u5e93\u7684\u6b65\u9aa4\uff1a \u786e\u8ba4 MySQL \u670d\u52a1\u662f\u5426\u5df2\u5b89\u88c5 \u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165 &#8220;d -V&#8221; \u547d\u4ee4\u3002 \u5982\u679c\u51fa\u73b0\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8868\u793a MySQL \u5df2\u5b89\u88c5\u3002 \u542f\u52a8 MySQL \u670d\u52a1 \u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a Linux\/macOS\uff1a sudo [&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-6444","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6444","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=6444"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6444\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}