{"id":2909,"date":"2016-09-25T18:26:06","date_gmt":"2016-09-25T10:26:06","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=2909"},"modified":"2016-09-25T18:26:06","modified_gmt":"2016-09-25T10:26:06","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e4%b8%80%e4%ba%9b%e4%bf%ae%e6%94%b9%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/2909.html","title":{"rendered":"MySQL\u6570\u636e\u5e93\u7684\u4e00\u4e9b\u4fee\u6539\u64cd\u4f5c"},"content":{"rendered":"<p>=Start=<\/p>\n<h5>\u7f18\u7531\uff1a<\/h5>\n<p>\u8bb0\u5f55\u5e38\u7528\u7684MySQL\u4fee\u6539\u64cd\u4f5c\uff0c\u65b9\u4fbf\u4ee5\u540e\u53c2\u8003\u3002<\/p>\n<h5>\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<h6>\u4fee\u6539MySQL\u5217\u7684\u5927\u5c0f<\/h6>\n<pre class=\"lang:default decode:true\">ALTER TABLE `table_name` MODIFY `col_name` VARCHAR(10000);\n\u6216\nALTER TABLE `table_name` CHANGE COLUMN `col_name` `col_name` VARCHAR(10000);<\/pre>\n<h6>\u4fee\u6539MySQL\u8868\u7684\u7d22\u5f15\u540d\u79f0<\/h6>\n<pre class=\"lang:default decode:true\">\u5bf9\u4e8e MySQL 5.7 \u53ca\u4ee5\u4e0a\u7684\u7248\u672c(\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u7d22\u5f15\u540d\u79f0)\uff1a\nALTER TABLE tbl_name RENAME INDEX old_index_name TO new_index_name;\n\n\u5bf9\u4e8e MySQL \u65e9\u671f\u7248\u672c(\u9700\u8981\u5148\u5220\u9664\u5df2\u6709\u7d22\u5f15\uff0c\u7136\u540e\u65b0\u5efa\u7d22\u5f15)\uff1a\nALTER TABLE tbl_name DROP INDEX old_index_name, ADD INDEX new_index_name (...);<\/pre>\n<h5>\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1463363\/how-do-i-rename-an-index-in-mysql\">http:\/\/stackoverflow.com\/questions\/1463363\/how-do-i-rename-an-index-in-mysql<\/a><\/li>\n<li><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/alter-table.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/alter-table.html<\/a><\/li>\n<\/ul>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u8bb0\u5f55\u5e38\u7528\u7684MySQL\u4fee\u6539\u64cd\u4f5c\uff0c\u65b9\u4fbf\u4ee5\u540e\u53c2\u8003\u3002 \u53c2\u8003\u89e3\u7b54\uff1a \u4fee\u6539MySQL\u5217\u7684\u5927\u5c0f AL [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23],"tags":[663,16],"class_list":["post-2909","post","type-post","status-publish","format-standard","hentry","category-database","category-knowledgebase-2","tag-alter","tag-mysql"],"views":5267,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=2909"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2909\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=2909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=2909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=2909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}