{"id":7023,"date":"2024-11-14T15:36:48","date_gmt":"2024-11-14T07:36:48","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7023\/"},"modified":"2024-11-14T15:36:48","modified_gmt":"2024-11-14T07:36:48","slug":"%e8%b6%85%e7%ba%a7%e5%b7%a8%e5%9e%8b-mysql-%e6%95%b0%e6%8d%ae%e8%a1%a8%e7%bb%93%e6%9e%84%e5%8f%98%e6%9b%b4%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%84%e9%81%bf%e9%a3%8e%e9%99%a9%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7023\/","title":{"rendered":"\u8d85\u7ea7\u5de8\u578b MySQL \u6570\u636e\u8868\u7ed3\u6784\u53d8\u66f4\uff0c\u5982\u4f55\u89c4\u907f\u98ce\u9669\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173028771917215.jpg\" class=\"aligncenter\" title=\"\u8d85\u7ea7\u5de8\u578b MySQL \u6570\u636e\u8868\u7ed3\u6784\u53d8\u66f4\uff0c\u5982\u4f55\u89c4\u907f\u98ce\u9669\uff1f\u63d2\u56fe\" alt=\"\u8d85\u7ea7\u5de8\u578b MySQL \u6570\u636e\u8868\u7ed3\u6784\u53d8\u66f4\uff0c\u5982\u4f55\u89c4\u907f\u98ce\u9669\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u8d85\u7ea7\u5de8\u578b  \u6570\u636e\u8868\u7684\u8868\u7ed3\u6784\u53d8\u66f4\u98ce\u9669\u89c4\u907f<\/strong><\/p>\n<p>\u968f\u7740\u4e1a\u52a1\u6570\u636e\u7684\u4e0d\u65ad\u7d2f\u79ef\uff0cmysql \u8868\u7684\u6570\u636e\u91cf\u53ef\u80fd\u589e\u957f\u5230\u5343\u4e07\u751a\u81f3\u4ebf\u7ea7\u3002\u6b64\u65f6\uff0c\u5982\u679c\u9700\u8981\u5bf9\u8868\u7ed3\u6784\u8fdb\u884c\u53d8\u66f4\uff0c\u4f8b\u5982\u4fee\u6539\u5b57\u6bb5\u957f\u5ea6\u3001\u7c7b\u578b\u6216\u6dfb\u52a0\u5b57\u6bb5\uff0c\u5c31\u4f1a\u9762\u4e34\u5de8\u5927\u7684\u98ce\u9669\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e1a\u52a1\u4e2d\u65ad\u6216\u3002<\/p>\n<p><strong>\u89c4\u907f\u98ce\u9669\u7684\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u907f\u514d\u6b64\u7c7b\u98ce\u9669\u7684\u5173\u952e\u5728\u4e8e\u91c7\u7528\u4e00\u79cd\u540d\u4e3a pt-osc \u7684\u5de5\u5177\u3002pt-osc\u662f\u4e00\u6b3e\u5f00\u6e90\u5de5\u5177\uff0c\u4e13\u95e8\u7528\u4e8e\u5728\u4e0d\u9501\u5b9a\u8868\u7684\u60c5\u51b5\u4e0b\u5b89\u5168\u5730\u5728\u7ebf\u4fee\u6539 mysql \u8868\u7ed3\u6784\u3002<\/p>\n<p><strong>pt-osc \u7684\u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n<p>pt-osc \u7684\u5de5\u4f5c\u539f\u7406\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li> <strong>\u521b\u5efa\u4e34\u65f6\u8868\uff1a<\/strong>\u5b83\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u65b0\u8868\u7ed3\u6784\u7684\u4e34\u65f6\u8868\u3002<\/li>\n<li> <strong>\u8f6c\u79fb\u6570\u636e\uff1a<\/strong>\u7136\u540e\uff0c\u5b83\u5c06\u6570\u636e\u4ece\u539f\u59cb\u8868\u9010\u884c\u8f6c\u79fb\u5230\u65b0\u8868\u3002<\/li>\n<li> <strong>\u91cd\u547d\u540d\u8868\uff1a<\/strong>\u5b8c\u6210\u6570\u636e\u8f6c\u79fb\u540e\uff0c\u5b83\u5c06\u65e7\u8868\u91cd\u547d\u540d\u4e3a\u65e7\u8868\uff0c\u5e76\u5c06\u65b0\u8868\u91cd\u547d\u540d\u4e3a\u65e7\u8868\u540d\u3002<\/li>\n<\/ol>\n<p><strong>\u5177\u4f53\u793a\u4f8b<\/strong><\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3a user_info \u7684\u8868\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u5b57\u6bb5\uff1a<\/p>\n<pre>id int(11) not null\nusername varchar(255) not null\npassword varchar(255) not null<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u9700\u8981\u5c06 username \u5217\u7684\u957f\u5ea6\u589e\u52a0\u5230 varchar(500)\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 pt-osc \u5982\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<pre>pt-osc mysql -h dbhost -u dbuser -p --user=#root --password=#123456 --alter \"ALTER user_info MODIFY username varchar(500)\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>pt-osc \u5c06\u6267\u884c\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u5728\u4e0d\u4e2d\u65ad\u5bf9\u8868\u8bbf\u95ee\u7684\u60c5\u51b5\u4e0b\u5b8c\u6210\u8868\u7ed3\u6784\u53d8\u66f4\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8d85\u7ea7\u5de8\u578b MySQL \u6570\u636e\u8868\u7ed3\u6784\u53d8\u66f4\uff0c\u5982\u4f55\u89c4\u907f\u98ce\u9669\uff1f\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>\u8d85\u7ea7\u5de8\u578b \u6570\u636e\u8868\u7684\u8868\u7ed3\u6784\u53d8\u66f4\u98ce\u9669\u89c4\u907f \u968f\u7740\u4e1a\u52a1\u6570\u636e\u7684\u4e0d\u65ad\u7d2f\u79ef\uff0cmysql \u8868\u7684\u6570\u636e\u91cf\u53ef\u80fd\u589e\u957f\u5230\u5343\u4e07\u751a\u81f3\u4ebf\u7ea7\u3002\u6b64\u65f6\uff0c\u5982\u679c\u9700\u8981\u5bf9\u8868\u7ed3\u6784\u8fdb\u884c\u53d8\u66f4\uff0c\u4f8b\u5982\u4fee\u6539\u5b57\u6bb5\u957f\u5ea6\u3001\u7c7b\u578b\u6216\u6dfb\u52a0\u5b57\u6bb5\uff0c\u5c31\u4f1a\u9762\u4e34\u5de8\u5927\u7684\u98ce\u9669\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e1a\u52a1\u4e2d\u65ad\u6216\u3002 \u89c4\u907f\u98ce\u9669\u7684\u89e3\u51b3\u65b9\u6848 \u907f\u514d\u6b64\u7c7b\u98ce\u9669\u7684\u5173\u952e\u5728\u4e8e\u91c7\u7528\u4e00\u79cd\u540d\u4e3a pt-osc \u7684\u5de5\u5177\u3002pt-osc\u662f\u4e00\u6b3e\u5f00\u6e90\u5de5\u5177\uff0c\u4e13\u95e8\u7528\u4e8e\u5728\u4e0d\u9501\u5b9a\u8868\u7684\u60c5\u51b5\u4e0b\u5b89\u5168\u5730\u5728\u7ebf\u4fee\u6539 mysql \u8868\u7ed3\u6784\u3002 pt-osc \u7684\u5de5\u4f5c\u539f\u7406 pt-osc \u7684\u5de5\u4f5c\u539f\u7406\u5982\u4e0b\uff1a \u521b\u5efa\u4e34\u65f6\u8868\uff1a\u5b83\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u65b0\u8868\u7ed3\u6784\u7684\u4e34\u65f6\u8868\u3002 \u8f6c\u79fb\u6570\u636e\uff1a\u7136\u540e\uff0c\u5b83\u5c06\u6570\u636e\u4ece\u539f\u59cb\u8868\u9010\u884c\u8f6c\u79fb\u5230\u65b0\u8868\u3002 \u91cd\u547d\u540d\u8868\uff1a\u5b8c\u6210\u6570\u636e\u8f6c\u79fb\u540e\uff0c\u5b83\u5c06\u65e7\u8868\u91cd\u547d\u540d\u4e3a\u65e7\u8868\uff0c\u5e76\u5c06\u65b0\u8868\u91cd\u547d\u540d\u4e3a\u65e7\u8868\u540d\u3002 \u5177\u4f53\u793a\u4f8b \u4f8b\u5982\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3a user_info \u7684\u8868\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u5b57\u6bb5\uff1a id int(11) not null username varchar(255) not null password varchar(255) not null \u767b\u5f55\u540e\u590d\u5236 \u73b0\u5728\uff0c\u6211\u4eec\u9700\u8981\u5c06 username \u5217\u7684\u957f\u5ea6\u589e\u52a0\u5230 varchar(500)\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 pt-osc \u5982\u4e0b\u64cd\u4f5c\uff1a pt-osc mysql -h dbhost -u dbuser -p &#8211;user=#root &#8211;password=#123456 &#8211;alter &#8220;ALTER user_info MODIFY username varchar(500)&#8221; [&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-7023","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7023","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=7023"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7023\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}