{"id":2300,"date":"2019-04-20T05:07:37","date_gmt":"2019-04-19T20:07:37","guid":{"rendered":"https:\/\/www.dogrow.net\/linux\/?p=2300"},"modified":"2023-12-29T01:29:44","modified_gmt":"2023-12-28T16:29:44","slug":"blog113","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/linux\/blog113\/","title":{"rendered":"(113)\u3010DB\u3011MySQL\u306e\u4efb\u610f\u306e\u30c6\u30fc\u30d6\u30eb\u3001\u4efb\u610f\u306e\u30ec\u30b3\u30fc\u30c9\u3092\u30c0\u30f3\u30d7\u3059\u308b\u3002"},"content":{"rendered":"<h1 class=\"my_h\">1. \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>Linux\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067 MySQL\u3092\u30c0\u30f3\u30d7\u3059\u308b\u3068\u304d\u306b\u3001<br \/>\n<span class=\"my_fc_deeppink my_fs_big2 my_fw_bold\">\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb<\/span> \u306e <span class=\"my_fc_deeppink my_fs_big2 my_fw_bold\">\u7279\u5b9a\u306e\u30ec\u30b3\u30fc\u30c9<\/span><br \/>\n\u3060\u3051\u3092\u30c0\u30f3\u30d7\u3057\u305f\u3044\u3002<\/p>\n<h1 class=\"my_h\">2. \u3084\u3063\u3066\u307f\u308b<\/h1>\n<h3 class=\"my_h\">Step 1 : \u666e\u901a\u306bDB\u3092\u5168\u30c0\u30f3\u30d7\u3059\u308b\u3002<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nDBNAME=aaaaa\r\nUSER=bbbbb\r\nPASS=ccccc\r\nmysqldump -u${USER} -p${PASS} $DBNAME &gt; dump.txt\r\n<\/pre>\n<h3 class=\"my_h\">Step 2 : \u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3092\u30c0\u30f3\u30d7\u3059\u308b\u3002<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nDBNAME=aaaaa\r\nUSER=bbbbb\r\nPASS=ccccc\r\nTABLE=ddddd\r\nmysqldump -u${USER} -p${PASS} $DBNAME $TABLE &gt; dump.txt\r\n<\/pre>\n<h3 class=\"my_h\">Step 3 : \u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u4e0a\u306e\u7279\u5b9a\u306e\u30ec\u30b3\u30fc\u30c9\u3060\u3051\u3092\u30c0\u30f3\u30d7\u3059\u308b\u3002<\/h3>\n<p><span class=\"my_fc_deeppink my_fw_bold\">&#8211;where<\/span> \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30ec\u30b3\u30fc\u30c9\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nDBNAME=aaaaa\r\nUSER=bbbbb\r\nPASS=ccccc\r\nTABLE=ddddd\r\nWHERE=&quot;id=12345&quot;\r\nmysqldump -u${USER} -p${PASS} $DBNAME $TABLE --where $WHERE &gt; dump.txt\r\n<\/pre>\n<h1 class=\"my_h\">\u25a0\u8ffd\u8a18 2021\/01\/29 \uff1a mysqldump\u3067\u30a8\u30e9\u30fc\u767a\u751f<\/h1>\n<p>DB\u3092\u5b9a\u671f\u7684\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306b\u3001cron\u3067 mysqldump\u3092\u5b9f\u884c\u3057\u3066\u3044\u305f\u3002<\/p>\n<p>\u3068\u3053\u308d\u304c&#8230;<br \/>\n\u3044\u3064\u306e\u9593\u306b\u304b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n<pre class=\"my_pre_bgBlack\">\r\nmysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces\r\n<\/pre>\n<p><span class=\"my_fc_crimsonB\">tablespaces\u3092\u30c0\u30f3\u30d7\u3059\u308b\u306e\u306b\u7279\u6a29\u304c\u5fc5\u8981<\/span><br \/>\n\u3068\u306e\u3053\u3068\u3060\u3002<\/p>\n<p>\u5171\u7528\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u6a29\u9650\u3092\u81ea\u7531\u306b\u8a2d\u5b9a\u53ef\u80fd\u304b\u4e0d\u660e\u3060\u3002<span class=\"my_fc_crimsonB\">\u8981\u8abf\u67fb<\/span><\/p>\n<p>\u305d\u3053\u3067&#8230;<br \/>\nCREATE TABLESPACE\u306a\u3069\u4f7f\u7528\u3057\u3066\u3044\u306a\u3044\u306e\u3067 mysqldump\u3092\u5b9f\u884c\u6642\u306b <span class=\"my_fc_deeppinkB\">&#8211;no-tablespaces<\/span> \u3092\u6307\u5b9a\u3057\u3001\u3053\u308c\u3092\u5bfe\u8c61\u5916\u3068\u3057\u305f\u3002<\/p>\n<pre class=\"my_pre_bgBlack\">\r\nDB={DB\u540d}\r\nUSER={\u30e6\u30fc\u30b6\u30fc\u540d}\r\nPW={\u30d1\u30b9\u30ef\u30fc\u30c9}\r\nFILE={\u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u540d}\r\nmysqldump $DB --host=localhost <span class=\"my_fc_deeppinkB\">--no-tablespaces<\/span> -u $USER --password=$PW -e --single-transaction > $FILE\r\n<\/pre>\n<p>\u3053\u308c\u3067\u4e0a\u8a18\u306e\u30a8\u30e9\u30fc\u306f\u767a\u751f\u3057\u306a\u304f\u306a\u3063\u305f\u3002<\/p>\n<h1 class=\"my_h\">\u25a0\u304a\u307e\u3051 : mysql\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u8d77\u52d5<\/h1>\n<pre class=\"my_pre_bgBlack\">\r\nDB={DB\u540d}\r\nUSER={\u30e6\u30fc\u30b6\u30fc\u540d}\r\nmysql -D $DB -u $USER -p\r\n<\/pre>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>1. \u3084\u308a\u305f\u3044\u3053\u3068 Linux\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067 MySQL\u3092\u30c0\u30f3\u30d7\u3059\u308b\u3068\u304d\u306b\u3001 \u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb \u306e \u7279\u5b9a\u306e\u30ec\u30b3\u30fc\u30c9 \u3060\u3051\u3092\u30c0\u30f3\u30d7\u3057\u305f\u3044\u3002 2. \u3084\u3063\u3066\u307f\u308b Step 1 : \u666e\u901a\u306bDB\u3092\u5168\u30c0\u30f3\u30d7\u3059\u308b\u3002 DBNAME=a\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/linux\/blog113\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[125,80],"tags":[],"class_list":["post-2300","post","type-post","status-publish","format-standard","hentry","category-db","category-mysql"],"views":1857,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/2300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/comments?post=2300"}],"version-history":[{"count":7,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/2300\/revisions"}],"predecessor-version":[{"id":3654,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/2300\/revisions\/3654"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/media?parent=2300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/categories?post=2300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/tags?post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}