{"id":1170,"date":"2004-04-16T01:25:55","date_gmt":"2004-04-16T01:25:55","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=1170"},"modified":"2004-04-16T01:25:55","modified_gmt":"2004-04-16T01:25:55","slug":"mysql-database-%ed%85%8c%ec%9d%b4%eb%b8%94-%eb%aa%a8%eb%91%90-%ec%b5%9c%ec%a0%81%ed%99%94%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=1170","title":{"rendered":"mysql Database \ud14c\uc774\ube14 \ubaa8\ub450 \ucd5c\uc801\ud654\ud558\uae30"},"content":{"rendered":"<p>\n\uc815\ucc2c\ud638<br \/>\nhttp:\/\/www.rootman.co.kr\/<br \/>\n http:\/\/www.rootman.co.kr\/bbs\/view.php?id=linux&#038;page=1&#038;sn1=&#038;divpage=1&#038;category=9&#038;sn=off&#038;ss=on&#038;sc=on&#038;select_arrange=headnum&#038;desc=asc&#038;no=1243<\/p>\n<p>\uc11c\ubc84\uc5d0 Mysql \ub370\uc774\ud130 \uc591\uc774 \ub9ce\uc774 \uc313\uc774\uace0, \ucffc\ub9ac \uc791\uc5c5\uc774 \ud65c\ubc1c\ud788 \uc77c\uc5b4\ub0a0\uacbd\uc6b0,<br \/>\n\uc774\uc5d0 \ub530\ub978 db \uc758 \uacf5\uac04 \ubd80\ub2f4\uc728\ub3c4 \ucee4\uc9c0\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc5d0 \ub530\ub77c, \uc591\uc774 \ub9ce\uc744 \uacbd\uc6b0 \ud558\ub098\ud558\ub098 \ucd5c\uc801\ud654\ub97c \ud574\uc904\uc218\ub3c4 \uc5c6\uace0, <br \/>\n\uc544\ub798\uc640 \uac19\uc774 \uac04\ub7b5\ud558\uac8c \uc258\uc744 \ub3cc\ub824\ubd24\uc2b5\ub2c8\ub2e4.<br \/>\n\uc804\uc5d4 php \uc258\ub85c \ub3cc\ub838\ub294\ub370 \ub2e4\uc18c \ub290\ub9b0\uac83 \uac19\ub354\uad70\uc694.<br \/>\nbash \ub85c \ubcc0\uacbd\ud574 \ubd24\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud639, \ud544\uc694\ud558\uc2e0\ubd84\ub4e4 \uc788\uc73c\uc2dc\uba74 \uac00\uc838\ub2e4\uac00, \uc4f0\uc138\uc694.<br \/>\n\ud654\uc77c\uba85\uc73c\ub85c \uc800\uc7a5\ud6c4 \uc2e4\ud589\uad8c\ud55c \uc8fc\uc2dc\uace0, \/etc\/cron.daily \uc5d0 \ub123\uc5b4 \uc8fc\uc138\uc694.<br \/>\n\ud558\ub8e8\uc5d0 \ud55c\ubc88\uc529 \ub3cc\ub9ac\uba74 \uc88b\uc744\ub4ef \ud558\ub124\uc694.<\/p>\n<p>\uc870\uae08\uc774\ub77c\ub3c4 \ub3c4\uc6c0\uc774 \ub418\uc5c8\uc73c\uba74 \ud558\ub294 \ubc14\ub7a8\uc73c\ub85c&#8230;.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#!\/bin\/sh<br \/>\n# 2004\/03\/20<br \/>\n# http:\/\/www.rootman.co.kr<br \/>\n# \uc81c\ubaa9 : mysql Database \ud14c\uc774\ube14 \ubaa8\ub450 \ucd5c\uc801\ud654\ud558\uae30<br \/>\n# \ubcc0\uacbd\uc0ac\ud56d : mysql root \ubcc0\uacbd<br \/>\n# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#<br \/>\nDB_cnt=0;<br \/>\nDB_pass=&#8221;\ub8e8\ud2b8\ud328\uc2a4\uc6cc\ub4dc&#8221;<br \/>\nTotal_Table=0;<br \/>\nDB_str=`mysql -u root -p${DB_pass} -e&#8221;show databases&#8221;`;<br \/>\nfor DB_for in ${DB_str}<br \/>\ndo<br \/>\n  if [ ${DB_for}  != &#8220;Database&#8221; ]; then<br \/>\n     TABLE_cnt=0;<br \/>\n     Table_str=`mysql -u root -p${DB_pass} -e&#8221;show tables&#8221; ${DB_for}`;<br \/>\n     for TABLE_for in ${Table_str}<br \/>\n     do<br \/>\n        Op_Str=`mysql -u root -p${DB_pass} -e&#8221;optimize table $TABLE_for&#8221; ${DB_for}`;<br \/>\n        echo &#8221; &#8211; DB\uba85 : ${DB_for} &#8211;> ${TABLE_for} &#8220;;<br \/>\n        let TABLE_cnt=TABLE_cnt+1;<br \/>\n     done<br \/>\n     echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;> \ud14c\uc774\ube14\uba85 : ${TABLE_cnt} \ucd5c\uc801\ud654\uc644\ub8cc.&#8221;;<br \/>\n     let Total_Table=Total_Table+${TABLE_cnt};<br \/>\n     sleep 1;<br \/>\n     let DB_cnt=DB_cnt+1;<br \/>\n  fi;<br \/>\ndone<br \/>\necho &#8220;====================================================================================&#8221;;<br \/>\necho &#8220;- \ud638\uc2a4\ud2b8\uba85 : `hostname` \uc5d0 \ub300\ud55c DB ${DB_cnt}\uac1c, \ud1a0\ud0c8\ud14c\uc774\ube14 ${Total_Table} \ucd5c\uc801\ud654 \uc644\ub8cc.&#8221;;<br \/>\necho &#8220;====================================================================================&#8221;; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc815\ucc2c\ud638 http:\/\/www.rootman.co.kr\/ http:\/\/www.rootman.co.kr\/bbs\/view.php?id=linux&#038;page=1&#038;sn1=&#038;divpage=1&#038;category=9&#038;sn=off&#038;ss=on&#038;sc=on&#038;select_arrange=headnum&#038;desc=asc&#038;no=1243 \uc11c\ubc84\uc5d0 Mysql \ub370\uc774\ud130 \uc591\uc774 \ub9ce\uc774 \uc313\uc774\uace0, \ucffc\ub9ac \uc791\uc5c5\uc774 \ud65c\ubc1c\ud788 \uc77c\uc5b4\ub0a0\uacbd\uc6b0, \uc774\uc5d0 \ub530\ub978 db \uc758 \uacf5\uac04 \ubd80\ub2f4\uc728\ub3c4 \ucee4\uc9c0\uac8c \ub429\ub2c8\ub2e4. \uc774\uc5d0 \ub530\ub77c, \uc591\uc774 \ub9ce\uc744 \uacbd\uc6b0 \ud558\ub098\ud558\ub098 \ucd5c\uc801\ud654\ub97c \ud574\uc904\uc218\ub3c4 \uc5c6\uace0, \uc544\ub798\uc640 \uac19\uc774 \uac04\ub7b5\ud558\uac8c \uc258\uc744 \ub3cc\ub824\ubd24\uc2b5\ub2c8\ub2e4. \uc804\uc5d4 php \uc258\ub85c \ub3cc\ub838\ub294\ub370 \ub2e4\uc18c \ub290\ub9b0\uac83 \uac19\ub354\uad70\uc694. bash \ub85c \ubcc0\uacbd\ud574 \ubd24\uc2b5\ub2c8\ub2e4. \ud639, \ud544\uc694\ud558\uc2e0\ubd84\ub4e4 \uc788\uc73c\uc2dc\uba74 \uac00\uc838\ub2e4\uac00, \uc4f0\uc138\uc694. \ud654\uc77c\uba85\uc73c\ub85c \uc800\uc7a5\ud6c4 \uc2e4\ud589\uad8c\ud55c \uc8fc\uc2dc\uace0, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-1170","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1170"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}