{"id":6454,"date":"2024-11-14T11:47:17","date_gmt":"2024-11-14T03:47:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6454\/"},"modified":"2024-11-14T11:47:17","modified_gmt":"2024-11-14T03:47:17","slug":"mysql%e4%b8%ad%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8b%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6454\/","title":{"rendered":"mysql\u4e2d\u600e\u4e48\u67e5\u770b\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u8981\u67e5\u770b mysql \u4e2d\u7684\u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u6253\u5f00 mysql \u547d\u4ee4\u884c\u754c\u9762\u3002\u5217\u51fa\u6240\u6709\u6570\u636e\u5e93\uff1a\u6267\u884c show databases; \u8bed\u53e5\u3002\u83b7\u53d6\u6570\u636e\u5e93\u8be6\u7ec6\u4fe1\u606f\uff1a\u5bf9\u4e8e\u7279\u5b9a\u6570\u636e\u5e93\uff0c\u6267\u884c show create database \u6570\u636e\u5e93\u540d; \u548c show table status from \u6570\u636e\u5e93\u540d; \u8bed\u53e5\u3002\u8fde\u63a5\u5230\u7279\u5b9a\u6570\u636e\u5e93\uff1a\u6267\u884c use \u6570\u636e\u5e93\u540d; \u8bed\u53e5\u3002\u67e5\u770b\u8868\uff1a\u6267\u884c show tables; \u548c describe \u8868\u540d; \u8bed\u53e5\u3002\u67e5\u770b\u6570\u636e\uff1a\u6267\u884c select * from \u8868\u540d; \u548c select \u5b57\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080507484491371.jpg\" class=\"aligncenter\" title=\"mysql\u4e2d\u600e\u4e48\u67e5\u770b\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u4e2d\u600e\u4e48\u67e5\u770b\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 MySQL \u4e2d\u67e5\u770b\u6570\u636e\u5e93\uff1f<\/strong><\/p>\n<p><strong>\u6253\u5f00 MySQL \u547d\u4ee4\u884c\u754c\u9762<\/strong><\/p>\n<ol>\n<li>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165  -u \u7528\u6237\u540d -p\uff0c\u5e76\u8f93\u5165\u5bc6\u7801\u3002<\/li>\n<\/ol>\n<p><strong>\u5217\u51fa\u6240\u6709\u6570\u636e\u5e93<\/strong><\/p>\n<ol>\n<li>\u6267\u884c SHOW DATABASES; \u8bed\u53e5\u3002\u8fd9\u5c06\u663e\u793a\u670d\u52a1\u5668\u4e0a\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\u3002<\/li>\n<\/ol>\n<p><strong>\u83b7\u53d6\u6570\u636e\u5e93\u8be6\u7ec6\u4fe1\u606f<\/strong><\/p>\n<ol>\n<li>\n<p>\u8981\u67e5\u770b\u7279\u5b9a\u6570\u636e\u5e93\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<ul>\n<li>SHOW CREATE DATABASE \u6570\u636e\u5e93\u540d;\uff1a\u663e\u793a\u6570\u636e\u5e93\u7684\u521b\u5efa\u8bed\u53e5\u3002<\/li>\n<li>SHOW TABLE STATUS FROM \u6570\u636e\u5e93\u540d;\uff1a\u663e\u793a\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>\u8fde\u63a5\u5230\u7279\u5b9a\u6570\u636e\u5e93<\/strong><\/p>\n<ol>\n<li>\n<p>\u8981\u8fde\u63a5\u5230\u7279\u5b9a\u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<ul>\n<li>USE \u6570\u636e\u5e93\u540d;\uff1a\u8fde\u63a5\u5230\u6307\u5b9a\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>\u67e5\u770b\u8868<\/strong><\/p>\n<ol>\n<li>\n<p>\u73b0\u5728\u60a8\u5df2\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff0c\u60a8\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\u6765\u67e5\u770b\u8868\uff1a<\/p>\n<ul>\n<li>SHOW TABLES;\uff1a\u663e\u793a\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u5217\u8868\u3002<\/li>\n<li>DESCRIBE \u8868\u540d;\uff1a\u663e\u793a\u6307\u5b9a\u8868\u7684\u7ed3\u6784\u548c\u7ea6\u675f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>\u67e5\u770b\u6570\u636e<\/strong><\/p>\n<ol>\n<li>\n<p>\u8981\u67e5\u770b\u8868\u4e2d\u7684\u6570\u636e\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<ul>\n<li>SELECT * FROM \u8868\u540d;\uff1a\u9009\u62e9\u8868\u4e2d\u7684\u6240\u6709\u884c\u3002<\/li>\n<li>SELECT \u5b57\u6bb5\u540d FROM \u8868\u540d WHERE \u6761\u4ef6;\uff1a\u6839\u636e\u6761\u4ef6\u9009\u62e9\u7279\u5b9a\u5b57\u6bb5\u7684\u7279\u5b9a\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e2d\u600e\u4e48\u67e5\u770b\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>\u8981\u67e5\u770b mysql \u4e2d\u7684\u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u6253\u5f00 mysql \u547d\u4ee4\u884c\u754c\u9762\u3002\u5217\u51fa\u6240\u6709\u6570\u636e\u5e93\uff1a\u6267\u884c show databases; \u8bed\u53e5\u3002\u83b7\u53d6\u6570\u636e\u5e93\u8be6\u7ec6\u4fe1\u606f\uff1a\u5bf9\u4e8e\u7279\u5b9a\u6570\u636e\u5e93\uff0c\u6267\u884c show create database \u6570\u636e\u5e93\u540d; \u548c show table status from \u6570\u636e\u5e93\u540d; \u8bed\u53e5\u3002\u8fde\u63a5\u5230\u7279\u5b9a\u6570\u636e\u5e93\uff1a\u6267\u884c use \u6570\u636e\u5e93\u540d; \u8bed\u53e5\u3002\u67e5\u770b\u8868\uff1a\u6267\u884c show tables; \u548c describe \u8868\u540d; \u8bed\u53e5\u3002\u67e5\u770b\u6570\u636e\uff1a\u6267\u884c select * from \u8868\u540d; \u548c select \u5b57 \u5982\u4f55\u5728 MySQL \u4e2d\u67e5\u770b\u6570\u636e\u5e93\uff1f \u6253\u5f00 MySQL \u547d\u4ee4\u884c\u754c\u9762 \u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165 -u \u7528\u6237\u540d -p\uff0c\u5e76\u8f93\u5165\u5bc6\u7801\u3002 \u5217\u51fa\u6240\u6709\u6570\u636e\u5e93 \u6267\u884c SHOW DATABASES; \u8bed\u53e5\u3002\u8fd9\u5c06\u663e\u793a\u670d\u52a1\u5668\u4e0a\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\u3002 \u83b7\u53d6\u6570\u636e\u5e93\u8be6\u7ec6\u4fe1\u606f \u8981\u67e5\u770b\u7279\u5b9a\u6570\u636e\u5e93\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a SHOW CREATE DATABASE [&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-6454","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6454","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=6454"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6454\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}