{"id":260,"date":"2025-10-17T16:50:30","date_gmt":"2025-10-17T08:50:30","guid":{"rendered":"https:\/\/www.youvii.site\/?p=260"},"modified":"2025-10-20T09:59:28","modified_gmt":"2025-10-20T01:59:28","slug":"shujukujichuer","status":"publish","type":"post","link":"https:\/\/www.youvii.site\/index.php\/archives\/shujukujichuer","title":{"rendered":"\u6570\u636e\u5e93\u57fa\u7840(\u4e8c)"},"content":{"rendered":"<h1>\u6570\u636e\u5e93\u57fa\u7840\u4e8c<\/h1>\n<p>\u6b64\u6b21\u8df3\u8fc7\u6570\u636e\u5e93\u64cd\u4f5c\u8bed\u53e5<\/p>\n<p>\u6570\u636e\u5e93\u64cd\u4f5c\u89c1\u7b14\u8bb0\u5185SQL server\u57fa\u672c\u64cd\u4f5c\u9644\u4ef6<\/p>\n<p><strong><font style=\"color:#ffffff;background-color:#333333;\">Mysql\u5b89\u5168\u503c\u5b88\u5e38\u7528\u8bed\u53e5<\/font><\/strong><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">1\u3001\u7528\u6237\u6743\u9650\u8bbe\u7f6e<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;Mysql\u4e2d\u7528\u6237\u662f\u5982\u4f55\u5b9a\u4e49\u7684<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u7528\u6237\u540d@\u4e3b\u673a\u57df<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">10.0.0.51<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">10.0.0.%<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">%<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">10.0.0.0\/255.255.255.0<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Db01<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Localhost<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">127.0.0.1<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;\u7528\u6237\u521b\u5efa <\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">create user xinjing@&#8217;%&#8217; identified by &#8216;123&#8217;;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;\u7528\u6237\u5220\u9664 <\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">drop user username;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">username\uff1a\u662f\u8981\u5220\u9664\u7684\u7528\u6237\u540d <\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u5982 drop user root@\u2018%\u2019<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Drop user \u2018\u2019@\u2018127.0.0.1\u2019 \u7528\u6237\u540d\u4e3a\u7a7a\u7684\u5220\u9664<\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;\u6743\u9650\u7ea7\u522b\u4ecb\u7ecd<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u5168\u5c40\u2014\u2014\u53ef\u4ee5\u7ba1\u7406\u6574\u4e2aMySQL<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u5e93\u2014\u2014\u53ef\u4ee5\u7ba1\u7406\u6307\u5b9a\u7684\u6570\u636e\u5e93<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u8868\u2014\u2014\u53ef\u4ee5\u7ba1\u7406\u6307\u5b9a\u6570\u636e\u5e93\u7684\u6307\u5b9a\u8868<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u5b57\u6bb5\u2014\u2014\u53ef\u4ee5\u7ba1\u7406\u6307\u5b9a\u6570\u636e\u5e93\u7684\u6307\u5b9a\u8868\u7684\u6307\u5b9a\u5b57\u6bb5\u3001<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u6743\u9650\u5b58\u50a8\u5728mysql\u5e93\u7684user, db, tables_priv, columns_priv, procs_priv\u8fd9\u51e0\u4e2a\u7cfb\u7edf\u8868 \u4e2d\uff0c\u5f85MySQL\u5b9e\u4f8b\u542f\u52a8\u540e\u5c31\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d<\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;\u67e5\u770b\u7528\u6237\u6743\u9650\u8d4b\u4e88\u60c5\u51b5<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">show grants for xinjing@&#8217;%&#8217;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;\u7528\u6237\u6388\u6743 <\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">grant all privileges on stu.* to \u2018xinjing\u2019@\u2019%\u2019 identified by \u2018123\u2019 with option;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">revoke all privileges on stu.* from &#8216;xinjing&#8217;@&#8217;%&#8217;; <\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">2\u3001\u5143\u6570\u636e\u67e5\u8be2<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Select version()\uff1b\u670d\u52a1\u5668\u7248\u672c\u4fe1\u606f<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Select database()\uff1b\u5f53\u524d\u6570\u636e\u5e93\u540d<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Select user():\u5f53\u524d\u7528\u6237\u540d<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Show status;\u670d\u52a1\u5668\u72b6\u6001<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Show variables;\u670d\u52a1\u5668\u914d\u7f6e\u53d8\u91cf<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Show global variables like \u2018%datadir%\u2018\uff1a\u770b\u6570\u636e\u6587\u4ef6\u5b58\u653e\u4f4d\u7f6e<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">show global variables like &#8216;%datadir%&#8217;; <\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">select @@datadir;  \u67e5\u8be2\u6570\u636e\u5e93\u7684\u8def\u5f84<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">select @@basedir  \u67e5\u8be2mysql\u7684\u5b89\u88c5\u8def\u5f84<\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">3\u3001union\u67e5\u8be2\u8be6\u89e3<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">union\u67e5\u8be2\u5c31\u662f\u628a2\u6761\u6216\u8005\u591a\u6761sql\u8bed\u53e5\u7684\u67e5\u8be2\u7ed3\u679c\uff0c\u5408\u5e76\u6210\u4e00\u4e2a\u7ed3\u679c\u96c6\u3002<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">  sql1: N\u884c\uff0csql2: M\u884c\uff0csql1 union sql2 &#8212;&gt; N+M\u884c<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u8981\u6c42\u7ed3\u679c\u96c6\u4e2d\u7684\u5217\u6570\u4e00\u81f4\u5c31\u53ef\u4ee5.\uff08\u5982\u90fd\u662f2\u5217\u6216\u8005N\u5217\uff09<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">union\u53d6\u51fa\u7684\u6700\u7ec8\u5217\u540d,\u4ee5\u7b2c1\u6761sql\u4e3a\u51c6<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">union\u67e5\u8be2\u9ed8\u8ba4\u4f1a\u53bb\u91cd\uff0c\u5982\u679c\u4e0d\u60f3\u53bb\u91cd\u5c31\u7528union all<\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">4\u3001\u5206\u7ec4\u67e5\u8be2\u5c55\u793a<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">GROUP_CONCAT() <\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">select sid,group_concat(cid),group_concat(cj order by cj desc SEPARATOR &#8216; &#8216;) from score<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">group by sid<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">5\u3001\u5b57\u7b26\u4e32\u51fd\u6570<\/font><\/p>\n<p><img loading="lazy" decoding="async" decoding=\"async\"  src=\"https:\/\/www.youvii.site\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/cdn.picui.cn\/vip\/2025\/10\/17\/68f202fb5d524.png\" class=\"lazy\" loading=\"lazy\" alt=\"1741862071468-fc972a14-d9d1-4170-b377-cfee412cb91f.png\" \/><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">6\u3001mysql\u6570\u636e\u5e93\u5bfc\u5165\u5bfc\u51fa<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; \u8868\u6570\u636e\uff08\u8bb0\u5f55\uff09\u5bfc\u5165\u5bfc\u51fa<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; \u5bfc\u51fa\u4e3atxt\u6587\u4ef6<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">select * from demo1 into outfile &#8216;\/temp\/utemp1data.txt&#8217;;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">use student;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">show VARIABLES like &quot;secure_file_priv&quot;;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8211;\u5bfc\u5165txt\u6587\u4ef6<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">load data local infile &#8216;\/root\/utemp1data.txt&#8217; into table temp;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysqldump\u5bfc\u51fa<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; dump\u51fa\u8868utemp1<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysqldump -uroot -p student utemp1&gt;utemp1.sql<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; dump\u51fa\u5e93student<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysqldump -uroot -p student&gt;student.sql<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; dump\u6240\u6709\u7684\u6570\u636e\u5e93\u53ca\u6570\u636e\u5e93\u8868<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysqldump -u root -p &#8211;all-databases&gt;mysqldatabases.sql; <\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysql\u7684\u6570\u636e\u5e93\u5bfc\u5165&quot;&lt;&quot;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; \u65b0\u5efa\u4e00\u4e2a\u6570\u636e\u5e93<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">create database dumpdemo1<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; \u56de\u5230mysql\u63a5\u53e3<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysql -u root -p654321 dumpdemo1&lt;student.sql<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; \u8fdb\u5165mysql\u9a8c\u8bc1<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">use dumpdemo1<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">show tables;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">&#8212; mysql\u7684\u6570\u636e\u5e93\u5bfc\u5165 &quot;source&quot;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">mysql -u root -p<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">create database sourcedumpdemo;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">source \/var\/lib\/mysql-files\/student.sql<\/font><\/p>\n<p><font style=\"color:#000000;\"><\/font><\/p>\n<p><strong><font style=\"color:#ffffff;background-color:#333333;\">\u6570\u636e\u5e93\u6f0f\u626b\u5de5\u5177scuba\u4ecb\u7ecd<\/font><\/strong><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">Scuba\u662f\u4e00\u6b3e\u6570\u636e\u5e93\u626b\u63cf\u8f6f\u4ef6<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u626b\u63cf\u6570\u636e\u5e93\u6f0f\u6d1e,\u5bfb\u627e\u4e0d\u5b89\u5168\u7684\u56e0\u7d20,\u63d0\u5347\u6570\u636e\u5e93\u5b89\u5168\u7b49\u7ea7,\u53ca\u65f6\u89e3\u51b3\u6f0f\u6d1e\u95ee\u9898;<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u652f\u6301Oracle,SQL Server,SAP Sybase,IBM DB2\u548cMySQL\u7b49\u6570\u636e\u5e93<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">\u672c\u5730\u9700\u8981\u5b89\u88c5\u6709jdk\u548cmysql-connector-java-5.1.44-bin.jar\u5373\u53ef<\/font><font style=\"color:#000000;\"><br \/>\n<\/font><\/p>\n<p><font style=\"color:#000000;background-color:#ffffff;\">java -verison<\/font><\/p>\n<p><img loading="lazy" decoding="async" decoding=\"async\"  src=\"https:\/\/www.youvii.site\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/cdn.picui.cn\/vip\/2025\/10\/17\/68f202fe40fb0.png\" class=\"lazy\" loading=\"lazy\" alt=\"1741862071237-4ecc15f6-ff11-403e-a55a-80b7227c8793.png\" \/><\/p>\n<p><img loading="lazy" decoding="async" decoding=\"async\"  src=\"https:\/\/www.youvii.site\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/cdn.picui.cn\/vip\/2025\/10\/17\/68f203069e4c9.png\" class=\"lazy\" loading=\"lazy\" alt=\"1741862071272-9e894c84-31c1-4306-b30e-1fb258aac3d1.png\" \/><\/p>\n<p>\u8fde\u63a5\u6570\u636e\u5e93<\/p>\n<p><img loading="lazy" decoding="async" decoding=\"async\"  src=\"https:\/\/www.youvii.site\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/cdn.picui.cn\/vip\/2025\/10\/17\/68f2030aba341.png\" class=\"lazy\" loading=\"lazy\" alt=\"1741862071258-959a7ccb-41af-4ced-b41b-8945761250c4.png\" \/><\/p>\n<p><img loading="lazy" decoding="async" decoding=\"async\"  src=\"https:\/\/www.youvii.site\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/cdn.picui.cn\/vip\/2025\/10\/17\/68f2030f26f6a.png\" class=\"lazy\" loading=\"lazy\" alt=\"1741862071461-d0e9258c-ed33-4908-aa91-e3ba72a96941.png\" \/><\/p>\n<blockquote>\n<p>\u66f4\u65b0: 2025-04-11 20:55:50<br \/>\n\u539f\u6587: <a href=\"http:\/\/www.yuque.com\/yuhui.net\/network\/ro58o7w6myf7ym39\">http:\/\/www.yuque.com\/yuhui.net\/network\/ro58o7w6myf7ym39<\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u6570\u636e\u5e93\u57fa\u7840\u4e8c \u6b64\u6b21\u8df3\u8fc7\u6570\u636e\u5e93\u64cd\u4f5c\u8bed\u53e5 \u6570\u636e\u5e93\u64cd\u4f5c\u89c1\u7b14\u8bb0\u5185SQL server\u57fa\u672c\u64cd\u4f5c\u9644\u4ef6 Mysql\u5b89\u5168\u503c\u5b88\u5e38\u7528\u8bed\u53e5 1\u3001\u7528\u6237\u6743\u9650\u8bbe\u7f6e &#8211;Mysql\u4e2d\u7528\u6237\u662f\u5982\u4f55\u5b9a\u4e49\u7684 \u7528\u6237\u540d@\u4e3b\u673a\u57df 10.0.0.51 10.0.0.% % 10.0.0.0\/255.255.255.0 Db01 Localhost 127.0.0.1 &#8211;\u7528\u6237\u521b\u5efa create user xinjing@&#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[60],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-database","tag-shujuku"],"_links":{"self":[{"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":0,"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youvii.site\/index.php\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}