{"id":229,"date":"2019-03-04T23:44:15","date_gmt":"2019-03-04T14:44:15","guid":{"rendered":"https:\/\/took.jp\/?p=229"},"modified":"2020-06-15T17:01:34","modified_gmt":"2020-06-15T08:01:34","slug":"post-229","status":"publish","type":"post","link":"https:\/\/took.jp\/tech-blog\/post-229\/","title":{"rendered":"MySQL\u30ed\u30b0\u30a4\u30f3\u30b3\u30de\u30f3\u30c9\u306e\u5fdc\u7528"},"content":{"rendered":"<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">mysql -u root -p<\/span><\/p>\n<p>MySQL\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3002<\/p>\n<p>\u6b21\u306e\u884c\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u3092\u6c42\u3081\u3089\u308c\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">show databases;<\/span><\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e00\u89a7\u3092\u8868\u793a\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">use \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d;<\/span><\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">show tables;<\/span><\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u4e00\u89a7\u3092\u8868\u793a\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">select * from \u30c6\u30fc\u30d6\u30eb\u540d;<\/span><\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u60c5\u5831\u5168\u3066\u3092\u8868\u793a\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">show column from \u30c6\u30fc\u30d6\u30eb\u540d;<\/span><\/p>\n<p>DDL(\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9)\u3092\u8868\u793a\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u30aa\u30d7\u30b7\u30e7\u30f3<\/strong><\/p>\n<p>-u\u3000\u30e6\u30fc\u30b6\u540d<\/p>\n<p>-p\u3000\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>-h\u3000\u30db\u30b9\u30c8\u540d<\/p>\n<p>-e\u3000\u30af\u30a8\u30ea<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u4e0a\u8a18\u3067\u5206\u5272\u3057\u3066\u3044\u305fSQL\u6587\u3092\u4e00\u6587\u306b\u307e\u3068\u3081\u3066\u66f8\u304f<\/strong><\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">mysql -u root -ppassword<\/span><\/p>\n<p>\u4e00\u6587\u306b\u307e\u3068\u3081\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u3092\u6c42\u3081\u3055\u305b\u306a\u3044\u3002<\/p>\n<p>\u6ce8\u3000\u30d1\u30b9\u30ef\u30fc\u30c9\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6307\u5b9a\u3059\u308b\u3068\u304d\u306b\u306f\u3001\u7a7a\u767d\u3092\u7a7a\u3051\u306a\u3044\u3002<\/p>\n<p>\u3082\u3057\u3001<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">mysql -u root -p password<\/span><\/p>\n<p>\u3092\u5b9f\u884c\u3057\u305f\u5834\u5408\u3001\u300cpassword\u300d\u306fDB\u540d\u3068\u6349\u3048\u3089\u308c\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>-e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u305d\u306e\u5f8c\u308d\u306b\u76f4\u63a5SQL\u6587\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u4eca\u307e\u3067\u306e\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">mysql -u root -p\u30d1\u30b9\u30ef\u30fc\u30c9\u3000\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3000-e\"\u30af\u30a8\u30ea\"<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3068\u5165\u529b\u3059\u308b\u3068\u3001\u4e00\u6587\u306b\u307e\u3068\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>(\u30af\u30a8\u30ea\u3068\u306fSQL\u6587\u306e\u3053\u3068\u3067\u3059)<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001\u3053\u308c\u3092<\/p>\n<p><span style=\"background-color: rgba(221, 221, 221, 0.867);\">mysql -u root -p\u30d1\u30b9\u30ef\u30fc\u30c9\u3000\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3000-e\"\u30af\u30a8\u30ea\" &gt;\u00a0C:\/Users\/\u30e6\u30fc\u30b6\u540d\/Documents\/test.txt<\/span><\/p>\n<p>\u3068\u3059\u308b\u3068\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u308a\u51fa\u3057\u305f\u60c5\u5831\u3092csv\u5f62\u5f0f\u3067test.txt\u306b\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\uff08txt\u304c\u306a\u3051\u308c\u3070\u4f5c\u6210\u3055\u308c\u307e\u3059\uff09<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mysql -u root -p MySQL\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3002 \u6b21\u306e\u884c\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u3092\u6c42\u3081\u3089\u308c\u308b\u3002 &nbsp; \u30ed\u30b0\u30a4\u30f3\u5f8c\u3001 show databases; \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e00\u89a7\u3092\u8868\u793a\u3002 &nbsp; use \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d; \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u2026<\/p>\n","protected":false},"author":3,"featured_media":2010,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,71,74],"tags":[],"class_list":["post-229","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-mysql","category-74"],"_links":{"self":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/229","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=229"}],"version-history":[{"count":0,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media\/2010"}],"wp:attachment":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}