{"id":6309,"date":"2024-11-14T10:27:37","date_gmt":"2024-11-14T02:27:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6309\/"},"modified":"2024-11-14T10:27:37","modified_gmt":"2024-11-14T02:27:37","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%85%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6309\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u547d\u4ee4\u5927\u5168"},"content":{"rendered":"<blockquote><p>\n  mysql \u547d\u4ee4\u5927\u5168\u5305\u62ec\u4ee5\u4e0b\u5e38\u89c1\u547d\u4ee4\uff1a\u6570\u636e\u64cd\u4f5c\uff1aselect \u83b7\u53d6\u6570\u636e\uff0cinsert \u65b0\u884c\uff0cupdate \u4fee\u6539\u503c\uff0cdelete \u5220\u9664\u884c\uff0ctruncate table \u6e05\u9664\u884c\uff0calter table \u4fee\u6539\u7ed3\u6784\u8868\u7ba1\u7406\uff1acreate table \u5efa\u8868\uff0cdrop table \u5220\u8868\uff0cdescribe \u63cf\u8ff0\u7ed3\u6784\uff0coptimize table \u4f18\u5316\u6027\u80fd\uff0crename table \u91cd\u547d\u540d\u6570\u636e\u5e93\u7ba1\u7406\uff1acreate database \u5efa\u5e93\uff0cdrop database \u5220\u5e93\uff0cuse database \u9009\u5e93\uff0cshow\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202407\/31\/2024073122163274634.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u547d\u4ee4\u5927\u5168\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u547d\u4ee4\u5927\u5168\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u547d\u4ee4\u5927\u5168<\/strong><\/p>\n<p>MySQL \u662f\u4e00\u4e2a\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u4ee5\u5176\u901f\u5ea6\u3001\u53ef\u9760\u6027\u548c\u7075\u6d3b\u6027\u800c\u95fb\u540d\u3002\u4ee5\u4e0b\u662f\u6240\u6709\u5e38\u7528\u7684 MySQL \u547d\u4ee4\u7684\u5217\u8868\uff1a<\/p>\n<p><strong>\u6570\u636e\u64cd\u4f5c\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>SELECT<\/strong>\uff1a\u4ece\u8868\u4e2d\u68c0\u7d22\u6570\u636e\u3002<\/li>\n<li> <strong>INSERT<\/strong>\uff1a\u5411\u8868\u4e2d\u63d2\u5165\u65b0\u884c\u3002<\/li>\n<li> <strong>UPDATE<\/strong>\uff1a\u4fee\u6539\u8868\u4e2d\u73b0\u6709\u884c\u7684\u503c\u3002<\/li>\n<li> <strong>DELETE<\/strong>\uff1a\u4ece\u8868\u4e2d\u5220\u9664\u884c\u3002<\/li>\n<li> <strong>TRUNCATE TABLE<\/strong>\uff1a\u5220\u9664\u8868\u4e2d\u7684\u6240\u6709\u884c\uff0c\u91ca\u653e\u7a7a\u95f4\u3002<\/li>\n<li> <strong>ALTER TABLE<\/strong>\uff1a\u4fee\u6539\u8868\u7684\u7ed3\u6784\uff08\u6dfb\u52a0\u6216\u5220\u9664\u5217\u3001\u66f4\u6539\u6570\u636e\u7c7b\u578b\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u8868\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>CREATE TABLE<\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u8868\u3002<\/li>\n<li> <strong>DROP TABLE<\/strong>\uff1a\u5220\u9664\u4e00\u4e2a\u8868\u3002<\/li>\n<li> <strong>DESCRIBE<\/strong>\uff1a\u663e\u793a\u8868\u7684\u7ed3\u6784\uff08\u5217\u540d\u79f0\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\uff09\u3002<\/li>\n<li> <strong>OPTIMIZE TABLE<\/strong>\uff1a\u4f18\u5316\u8868\u7684\u6027\u80fd\u3002<\/li>\n<li> <strong>RENAME TABLE<\/strong>\uff1a\u91cd\u547d\u540d\u4e00\u4e2a\u8868\u3002<\/li>\n<\/ul>\n<p><strong>\u6570\u636e\u5e93\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>CREATE DATABASE<\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u636e\u5e93\u3002<\/li>\n<li> <strong>DROP DATABASE<\/strong>\uff1a\u5220\u9664\u4e00\u4e2a\u6570\u636e\u5e93\u3002<\/li>\n<li> <strong>USE DATABASE<\/strong>\uff1a\u9009\u62e9\u4e00\u4e2a\u6570\u636e\u5e93\u3002<\/li>\n<li> <strong>SHOW DATABASES<\/strong>\uff1a\u663e\u793a\u6240\u6709\u6570\u636e\u5e93\u3002<\/li>\n<li> <strong>SHOW TABLES<\/strong>\uff1a\u663e\u793a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002<\/li>\n<\/ul>\n<p><strong>\u7528\u6237\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>CREATE USER<\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237\u3002<\/li>\n<li> <strong>GRANT<\/strong>\uff1a\u6388\u4e88\u7528\u6237\u5bf9\u5bf9\u8c61\uff08\u4f8b\u5982\u8868\u6216\u6570\u636e\u5e93\uff09\u7684\u6743\u9650\u3002<\/li>\n<li> <strong>REVOKE<\/strong>\uff1a\u64a4\u9500\u7528\u6237\u5bf9\u5bf9\u8c61\u7684\u6743\u9650\u3002<\/li>\n<li> <strong>ALTER USER<\/strong>\uff1a\u4fee\u6539\u7528\u6237\u5bc6\u7801\u6216\u5176\u4ed6\u5c5e\u6027\u3002<\/li>\n<\/ul>\n<p><strong>\u8fde\u63a5\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>CONNECT<\/strong>\uff1a\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u3002<\/li>\n<li> <strong>DISCONNECT<\/strong>\uff1a\u4ece MySQL \u670d\u52a1\u5668\u65ad\u5f00\u8fde\u63a5\u3002<\/li>\n<li> <strong>SHOW CONNECTIONS<\/strong>\uff1a\u663e\u793a\u5f53\u524d\u6d3b\u52a8\u8fde\u63a5\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u6709\u7528\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>HELP<\/strong>\uff1a\u663e\u793a\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\u3002<\/li>\n<li> <strong>EXIT<\/strong>\uff1a\u9000\u51fa MySQL \u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li> <strong>SET<\/strong>\uff1a\u8bbe\u7f6e\u4f1a\u8bdd\u53d8\u91cf\uff08\u4f8b\u5982\u5b57\u7b26\u96c6\u6216\u65f6\u533a\uff09\u3002<\/li>\n<li> <strong>SHOW VARIABLES<\/strong>\uff1a\u663e\u793a MySQL \u670d\u52a1\u5668\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u547d\u4ee4\u5927\u5168\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>mysql \u547d\u4ee4\u5927\u5168\u5305\u62ec\u4ee5\u4e0b\u5e38\u89c1\u547d\u4ee4\uff1a\u6570\u636e\u64cd\u4f5c\uff1aselect \u83b7\u53d6\u6570\u636e\uff0cinsert \u65b0\u884c\uff0cupdate \u4fee\u6539\u503c\uff0cdelete \u5220\u9664\u884c\uff0ctruncate table \u6e05\u9664\u884c\uff0calter table \u4fee\u6539\u7ed3\u6784\u8868\u7ba1\u7406\uff1acreate table \u5efa\u8868\uff0cdrop table \u5220\u8868\uff0cdescribe \u63cf\u8ff0\u7ed3\u6784\uff0coptimize table \u4f18\u5316\u6027\u80fd\uff0crename table \u91cd\u547d\u540d\u6570\u636e\u5e93\u7ba1\u7406\uff1acreate database \u5efa\u5e93\uff0cdrop database \u5220\u5e93\uff0cuse database \u9009\u5e93\uff0cshow MySQL \u547d\u4ee4\u5927\u5168 MySQL \u662f\u4e00\u4e2a\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u4ee5\u5176\u901f\u5ea6\u3001\u53ef\u9760\u6027\u548c\u7075\u6d3b\u6027\u800c\u95fb\u540d\u3002\u4ee5\u4e0b\u662f\u6240\u6709\u5e38\u7528\u7684 MySQL \u547d\u4ee4\u7684\u5217\u8868\uff1a \u6570\u636e\u64cd\u4f5c\u547d\u4ee4 SELECT\uff1a\u4ece\u8868\u4e2d\u68c0\u7d22\u6570\u636e\u3002 INSERT\uff1a\u5411\u8868\u4e2d\u63d2\u5165\u65b0\u884c\u3002 UPDATE\uff1a\u4fee\u6539\u8868\u4e2d\u73b0\u6709\u884c\u7684\u503c\u3002 DELETE\uff1a\u4ece\u8868\u4e2d\u5220\u9664\u884c\u3002 TRUNCATE TABLE\uff1a\u5220\u9664\u8868\u4e2d\u7684\u6240\u6709\u884c\uff0c\u91ca\u653e\u7a7a\u95f4\u3002 ALTER TABLE\uff1a\u4fee\u6539\u8868\u7684\u7ed3\u6784\uff08\u6dfb\u52a0\u6216\u5220\u9664\u5217\u3001\u66f4\u6539\u6570\u636e\u7c7b\u578b\uff09\u3002 \u8868\u7ba1\u7406\u547d\u4ee4 CREATE TABLE\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u8868\u3002 DROP TABLE\uff1a\u5220\u9664\u4e00\u4e2a\u8868\u3002 DESCRIBE\uff1a\u663e\u793a\u8868\u7684\u7ed3\u6784\uff08\u5217\u540d\u79f0\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\uff09\u3002 OPTIMIZE TABLE\uff1a\u4f18\u5316\u8868\u7684\u6027\u80fd\u3002 RENAME TABLE\uff1a\u91cd\u547d\u540d\u4e00\u4e2a\u8868\u3002 \u6570\u636e\u5e93\u7ba1\u7406\u547d\u4ee4 CREATE DATABASE\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u636e\u5e93\u3002 DROP DATABASE\uff1a\u5220\u9664\u4e00\u4e2a\u6570\u636e\u5e93\u3002 [&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-6309","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6309","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=6309"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6309\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}