{"id":2011,"date":"2015-06-29T14:10:49","date_gmt":"2015-06-29T05:10:49","guid":{"rendered":"http:\/\/blog.rutake.com\/techmemo\/?p=2011"},"modified":"2015-06-29T15:38:23","modified_gmt":"2015-06-29T06:38:23","slug":"ansible-mysql%e3%82%92%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/blog.rutake.com\/techmemo\/2015\/06\/29\/ansible-mysql%e3%82%92%e6%93%8d%e4%bd%9c\/","title":{"rendered":"Ansible MySQL\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306b\u306f\u30ea\u30e2\u30fc\u30c8\u5074\u306bMySQL-python\u304c\u5fc5\u8981\u3002"},"content":{"rendered":"<p>MySQL\u3082Ansible\u304b\u3089\u64cd\u4f5c\u3067\u304d\u308b\u306e\u3060\u304c\u3001python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3060\u3068\u6012\u3089\u308c\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n<p>msg: the python mysqldb module is required<\/p>\n<p>AmazonLinux\u306a\u3089\u3070MySQL-python\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001pip-2.7\u7d4c\u7531\u3067ansible\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3053\u308c\u3067\u3082\u30c0\u30e1\u3060\u3063\u305f\u3088\u3046\u3060\u3002<\/p>\n<p>\u6b21\u306fpip-2.7\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n[shell]<br \/>\npip-2.7 install MySQL-python<br \/>\nYou are using pip version 6.0.8, however version 7.0.3 is available.<br \/>\nYou should consider upgrading via the &#8216;pip install &#8211;upgrade pip&#8217; command.<br \/>\nCollecting MySQL-python<br \/>\n  Downloading MySQL-python-1.2.5.zip (108kB)<br \/>\n    100% |################################| 110kB 4.0MB\/s<br \/>\n    sh: mysql_config: \u30b3\u30de\u30f3\u30c9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093<br \/>\n[\/shell]<\/p>\n<p>mysql-devel\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u518d\u5b9f\u65bd\u3002\u4eca\u5ea6\u306fgcc\u304c\u306a\u304f\u3066\u30a8\u30e9\u30fc\u30fb\u30fb<\/p>\n<p>\u7121\u4e8b\u30b3\u30f3\u30d1\u30a4\u30eb\u6210\u529f\u3057\u305f\u3051\u3069\u3001\u307e\u3060mysqldb module\u304c\u306a\u3044\u3068\u306e\u30a8\u30e9\u30fc\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>[shell]<br \/>\npip-2.7 freeze | grep -i mysql<br \/>\nYou are using pip version 6.0.8, however version 7.0.3 is available.<br \/>\nYou should consider upgrading via the &#8216;pip install &#8211;upgrade pip&#8217; command.<br \/>\nMySQL-python==1.2.5<br \/>\n[\/shell]<\/p>\n<p>\u3061\u3083\u3093\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u306e\u306b\uff01\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u64a4\u9000\u3057\u304b\u304b\u308b\u304c\u3001<br \/>\n\u3053\u3053\u3067\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b<\/p>\n<p>\u300cNote<br \/>\nRequires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as apt-get install python-mysqldb. (See apt.)\u300d<\/p>\n<p>\u306a\u3093\u3068\u30ea\u30e2\u30fc\u30c8\u5074\u306b\u30a4\u30f3\u30b9\u30fc\u30eb\u304c\u5fc5\u8981\u3060\u3068\u3055\uff01\u9811\u5f35\u3063\u3066\u64cd\u4f5c\u3059\u308b\u65b9\u306b\u5165\u308c\u3066\u3044\u305f\u3068\u3044\u3046\u30fb\u30fb\u30fb\u3042\u307b\u304b\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u3082Ansible\u304b\u3089\u64cd\u4f5c\u3067\u304d\u308b\u306e\u3060\u304c\u3001python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3060 &hellip; <a href=\"https:\/\/blog.rutake.com\/techmemo\/2015\/06\/29\/ansible-mysql%e3%82%92%e6%93%8d%e4%bd%9c\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[364,7,147],"tags":[365,423,379],"_links":{"self":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/2011"}],"collection":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/comments?post=2011"}],"version-history":[{"count":3,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/2011\/revisions"}],"predecessor-version":[{"id":2014,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/2011\/revisions\/2014"}],"wp:attachment":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/media?parent=2011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/categories?post=2011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/tags?post=2011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}