{"id":781,"date":"2019-08-29T06:40:04","date_gmt":"2019-08-28T21:40:04","guid":{"rendered":"https:\/\/took.jp\/?p=781"},"modified":"2020-06-15T15:31:24","modified_gmt":"2020-06-15T06:31:24","slug":"post-781","status":"publish","type":"post","link":"https:\/\/took.jp\/tech-blog\/post-781\/","title":{"rendered":"ALTER TABLE RENAME COLUMN \u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-sql\">ERROR 1064 (42000): You have an error in your SQL syntax;\r\n check the manual that corresponds to your MySQL server version for the right syntax<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u306f\u3001MySQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u308b\u539f\u56e0\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>ALTER TABLE RENAME COLUMN\u306f\u3001MySQL8.0\u304b\u3089\u5229\u7528\u3067\u304d\u308b\u69cb\u6587\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u81ea\u8eab\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u77e5\u3089\u306a\u3044\u4eba\u306f\u3001\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">mysql --version<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>\u5bfe\u7b56<\/h2>\n<p>ALTER TABLE CHANGE\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>ALTER TABLE RENAME COLUMN\u306e\u5834\u5408\u306f\u3001\u30ab\u30e9\u30e0\u540d\u3060\u3051\u306e\u5909\u66f4\u304c\u53ef\u80fd\u3067\u3057\u305f\u304c\u3001<\/p>\n<p>ALTER TABLE CHANGE\u306e\u5834\u5408\u306f\u3001\u30ab\u30e9\u30e0\u540d\u306e\u5909\u66f4\u3068\u3044\u3046\u3088\u308a\u3001\u30ab\u30e9\u30e0\u306e\u518d\u5b9a\u7fa9\u3068\u3044\u3063\u305f\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u5236\u7d04\u7b49\u3082\u518d\u5ea6\u66f8\u304d\u76f4\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001ALTER TABLE CHANGE\u306e\u4f8b\u3067\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-sql\">ALTER TABLE \u30c6\u30fc\u30d6\u30eb\u540d CHANGE \u65e7\u30ab\u30e9\u30e0\u540d \u65b0\u30ab\u30e9\u30e0\u540d int(11) NOT NULL COMMENT '\u30b3\u30e1\u30f3\u30c8';<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001NOT NULL\u5236\u7d04\u3084\u30b3\u30e1\u30f3\u30c8\u306f\u5fc5\u9808\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u7701\u7565\u3057\u3066\u3082\u30a8\u30e9\u30fc\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u304c\u3001<\/p>\n<p>\u578b\u306e\u6307\u5b9a\u3092\u7701\u7565\u3059\u308b\u3068\u3001\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u306a\u305c\u9593\u9055\u3048\u308b\u306e\u304b<\/h2>\n<p>\u30ab\u30e9\u30e0\u540d\u306e\u5909\u66f4(ALTER TABLE RENAME COLUMN)\u306f\u3001MySQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f38.0\u4ee5\u964d\u3067\u306a\u3044\u3068\u4f7f\u7528\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3059\u304c\u3001<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u540d\u306e\u5909\u66f4(ALTER TABLE RENAME)\u306f\u4f7f\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u9593\u9055\u3048\u3066\u3057\u307e\u3046\u5834\u5408\u304c\u591a\u3044\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3066\u3082\u3084\u3084\u3053\u3057\u3044\u3067\u3059\u306d...\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3059\u3002 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQ\u2026<\/p>\n","protected":false},"author":3,"featured_media":1933,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,71],"tags":[],"class_list":["post-781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-mysql"],"_links":{"self":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/comments?post=781"}],"version-history":[{"count":0,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/781\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media\/1933"}],"wp:attachment":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media?parent=781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/categories?post=781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/tags?post=781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}