{"id":5876,"date":"2013-11-30T17:16:54","date_gmt":"2013-11-30T09:16:54","guid":{"rendered":"http:\/\/jpuyy.com\/?p=5876"},"modified":"2013-11-30T17:17:16","modified_gmt":"2013-11-30T09:17:16","slug":"mysql-move-tables","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=5876","title":{"rendered":"mysql\u5c06\u4e00\u5f20\u8868\u79fb\u52a8\u5230\u53e6\u5916\u7684\u5e93\u4e2d"},"content":{"rendered":"<p>\u73b0\u5728\u6709db1.table1\u8868\uff0c\u73b0\u5728\u8981\u5c06\u5b83\u653e\u5230db2\u4e2d\uff0c\u6700\u7b80\u7684\u65b9\u6cd5\u662fmysqldump\u5bfc\u51fa\uff0c\u518d\u5bfc\u5165\u3002<\/p>\n<p>\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f<\/p>\n<pre>create table db2.table2 as select * from db1.table1;<\/pre>\n<p>\u7ed3\u6784\uff0c\u6570\u636e\u5185\u5bb9\u4e00\u81f4\uff0c\u4f46\u662f\u4e0d\u4f1a\u590d\u5236\u7d22\u5f15\u4ee5\u53ca\u5916\u952e<\/p>\n<p>\u8981\u4fdd\u6301\u5b8c\u5168\u4e00\u81f4\uff0c\u5219\u4e24\u6b65\u64cd\u4f5c\uff0c\u5148\u590d\u5236\u8868\u7ed3\u6784\uff0c\u518d\u590d\u5236\u6570\u636e<\/p>\n<pre>create table db2.table2\u00a0like\u00a0db1.table1;\r\ninsert into db2.table2\u00a0select * from db1.table1;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u5728\u6709db1.table1\u8868\uff0c\u73b0\u5728\u8981\u5c06\u5b83\u653e\u5230db2\u4e2d\uff0c\u6700\u7b80\u7684\u65b9\u6cd5\u662fmysqldump\u5bfc\u51fa\uff0c\u518d\u5bfc\u5165\u3002 \u53e6\u4e00\u79cd\u65b9\u6cd5\u662f create table db2.table2 as select * from db1.table1; \u7ed3\u6784\uff0c\u6570\u636e\u5185\u5bb9\u4e00\u81f4\uff0c\u4f46\u662f\u4e0d\u4f1a\u590d\u5236\u7d22\u5f15\u4ee5\u53ca\u5916\u952e \u8981\u4fdd\u6301\u5b8c\u5168\u4e00\u81f4\uff0c\u5219\u4e24\u6b65\u64cd\u4f5c\uff0c\u5148\u590d\u5236\u8868\u7ed3\u6784\uff0c\u518d\u590d\u5236\u6570\u636e create table db2.table2\u00a0like\u00a0db1.table1; insert into db2.table2\u00a0select * from db1.table1;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,65],"tags":[163],"class_list":["post-5876","post","type-post","status-publish","format-standard","hentry","category-life","category-mysql","tag-mysql"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5876"}],"version-history":[{"count":2,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5876\/revisions"}],"predecessor-version":[{"id":5932,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5876\/revisions\/5932"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}