{"id":12,"date":"2019-07-04T10:37:19","date_gmt":"2019-07-04T01:37:19","guid":{"rendered":"https:\/\/hyandmj.asuscomm.com\/hblog\/?p=12"},"modified":"2021-05-03T19:46:27","modified_gmt":"2021-05-03T10:46:27","slug":"mysql-%ea%b3%84%ec%a0%95-%ec%83%9d%ec%84%b1-%ea%b4%80%eb%a6%ac-%eb%b0%8f-%ea%b6%8c%ed%95%9c-%ec%84%a4%ec%a0%95","status":"publish","type":"post","link":"https:\/\/hyandmj.asuscomm.com\/hblog\/?p=12","title":{"rendered":"MySQL \uacc4\uc815 \uc0dd\uc131 \uad00\ub9ac \ubc0f \uad8c\ud55c \uc124\uc815"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Motive<\/h3>\n\n\n\n<p>\uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\ub4e4\uc740 \ub300\uac1c \ub85c\uceec\uc0c1\uc758 DB\ub97c \uc774\uc6a9\ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 MySQL\uc744 \uc0ac\uc6a9\ud574\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uad00\ub9ac\ud55c\ub2e4. \uc9c0\uae08 \uc774 \uae00\ub3c4 MySQL \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c \uc6cc\ub4dc\ud504\ub808\uc2a4\uac00 \uc124\uce58\ub41c \uc11c\ubc84\uc5d0 \uc811\uc18d\ud574\uc11c \ub4e4\uc5b4\uac00\ubcf4\uba74 DB\uc758 \uc5b4\ub290 \ud55c \ud14c\uc774\ube14\uc5d0 \ub0b4\uc6a9\ubb3c\uc774 \uace0\uc2a4\ub780\ud788 \uc788\uc74c\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. (\uc554\ud638\ud654\ub294 \uc548\ub418\uc5b4\uc788\uc5c8\uc74c) \ub098\ub294 \ubcf4\ud1b5 \uc11c\ube44\uc2a4\ub9c8\ub2e4 \ubcc4\ub3c4\uc758 MySQL \uacc4\uc815\uacfc \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ub9cc\ub4e4\uc5b4\uc8fc\uace0 \uc811\uc18d\uc740 \ub85c\uceec\uc5d0\uc11c\ub9cc \uac00\ub2a5\ud558\ub3c4\ub85d \uc124\uc815\ud55c\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud658\uacbd<\/h3>\n\n\n\n<p>\ub178\ub4dc: \uadf8\ub0e5 \ud3c9\ubc94\ud55c \ub370\uc2a4\ud06c\ud0d1 (\uc0ac\uc2e4\uc740 \ubc14\ub85c \uc774 \ube14\ub85c\uadf8\uac00 \ub3cc\uc544\uac00\uace0 \uc788\ub294 \uc11c\ubc84\ucef4)<br>OS: \uc6b0\ubd84\ud22c 18.04.2 LTS<br>MySQL \ubc84\uc804: 5.7.26<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Procedure<\/h3>\n\n\n\n<p>\ucc38\uace0 \ub9c1\ud06c:  <a href=\"https:\/\/2dubbing.tistory.com\/13\">https:\/\/2dubbing.tistory.com\/13<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">i) \uc811\uc18d<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo mysql -u root -p<\/code><\/pre>\n\n\n\n<p><code>sudo<\/code>\ub97c \uc548\ud558\ub2c8\uae4c <code>root<\/code> \uacc4\uc815\uc73c\ub85c \uc811\uc18d\uc774 \uc548\ub41c\ub2e4. \ucca8\uc5d4 \ube44\ubc00\ubc88\ud638 \uc78a\uc5b4\ubc84\ub9b0\uc904 \uc54c\uc558\ub2e4. \uc815\ub9d0 \ube44\ubc00\ubc88\ud638\ub97c \uc78a\uc5b4\uba39\uc5c8\ub2e4\uba74 \uc560\ub3c4\ub97c \ud45c\ud558\uace0 \uad6c\uae00 \uac80\uc0c9\uc744 \ud1b5\ud574 \ubc29\ubc95\uc744 \ucc3e\uc544 \ube44\ubc88 \ucd08\uae30\ud654\ub97c \uc9c4\ud589\ud574\uc57c \ud55c\ub2e4. \ubb3c\ub860 <code>-u<\/code> \uc635\uc158 \ub4a4\uc5d0\ub294 \uacc4\uc815\uba85\uc774 \ub4e4\uc5b4\uac00\uac8c \ub418\uace0, \uad73\uc774 <code>root<\/code> \uacc4\uc815\uc774 \uc544\ub2c8\ub354\ub77c\ub3c4 \uad8c\ud55c \ube60\ubc29\ud55c \uacc4\uc815\uc774 \uc788\uc73c\uba74 \uadf8\uac70\ub85c \uc811\uc18d\ud574\ub3c4 \ub41c\ub2e4.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">ii) \uacc4\uc815 \uc0dd\uc131<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; create user '\uacc4\uc815\uc544\uc774\ub514'@localhost identified by '\ube44\ubc00\ubc88\ud638';<\/code><\/pre>\n\n\n\n<p>\ub2f9\uc5f0\ud788 \ubcc4 \ubb38\uc81c\uc5c6\uc774 \uc798 \ub9cc\ub4e4\uc5b4\uc84c\uaca0\uac70\ub2c8 \ud558\uba74 \ub418\uace0 \ud639\uc2dc\ub77c\ub3c4 \uc81c\ub300\ub85c \uacc4\uc815\uc774 \ucd94\uac00\ub418\uc5c8\ub294\uc9c0\ub97c \uc870\ud68c\ud558\uace0 \uc2f6\ub2e4\uba74,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; use mysql;\nmysql&gt; show tables;\nmysql&gt; select host, user, authentication_string from user;<\/code><\/pre>\n\n\n\n<p>\ub97c \ud574\ubcf4\uba74 MySQL\uc758 \uc720\uc800 \ubaa9\ub85d\uc774 \ub72c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; select host, user, authentication_string from user;\n+-----------+------------------+-------------------------------------------+\n| host      | user             | authentication_string                     |\n+-----------+------------------+-------------------------------------------+\n| localhost | root             | *???????????????????????????????????????? |\n| localhost | mysql.session    | *???????????????????????????????????????? |\n| localhost | mysql.sys        | *???????????????????????????????????????? |\n| localhost | debian-sys-maint | *???????????????????????????????????????? |\n| localhost | piwigo           | *???????????????????????????????????????? |\n| localhost | git              | *???????????????????????????????????????? |\n| localhost | redmine          | *???????????????????????????????????????? |\n| localhost | openproject      | *???????????????????????????????????????? |\n+-----------+------------------+-------------------------------------------+\n8 rows in set (0.00 sec)\n\nmysql&gt; <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">iii) \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc0dd\uc131<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; create database &#91;DB name];<\/code><\/pre>\n\n\n\n<p>[DB name]\uc758 \uc790\ub9ac\uc5d4 \uc6d0\ud558\ub294 DB \uc774\ub984\uc744 \uc801\uc5b4\uc8fc\uba74 \ub41c\ub2e4.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">iv) \uc0dd\uc131\ud55c DB\uc5d0 \uad8c\ud55c \ubd80\uc5ec<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; grant all privileges on &#91;DB name].* to '\uacc4\uc815\uc544\uc774\ub514'@localhost;<\/code><\/pre>\n\n\n\n<p>\ub2e4\ub978 \uc124\uba85\uc758 \uacbd\uc6b0 \ucffc\ub9ac \ub4a4\uc5d0 <code>identified by<\/code> \uc5b4\uca4c\uace0 \ud558\uba74\uc11c \ud328\uc2a4\uc6cc\ub4dc\ub97c \uc801\uc73c\ub77c\ub294 \uacbd\uc6b0\ub3c4 \uc788\ub294\ub370, \ub0b4 \uacbd\uc6b0\uc5d4 \uac15\ub825\ud55c <code>root<\/code> \uacc4\uc815\uc73c\ub85c \ud558\uace0\uc788\ub294 \uc911\uc774\ub77c \uacc4\uc815\uc758 \ube44\ubc00\ubc88\ud638 \ub530\uc708 \ud544\uc694\uc5c6\uc774 \uadf8\ub0e5 \ub418\ub294\ub4ef.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Motive \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\ub4e4\uc740 \ub300\uac1c \ub85c\uceec\uc0c1\uc758 DB\ub97c \uc774\uc6a9\ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 MySQL\uc744 \uc0ac\uc6a9\ud574\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uad00\ub9ac\ud55c\ub2e4. \uc9c0\uae08 \uc774 \uae00\ub3c4 MySQL \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c \uc6cc\ub4dc\ud504\ub808\uc2a4\uac00 \uc124\uce58\ub41c \uc11c\ubc84\uc5d0 \uc811\uc18d\ud574\uc11c \ub4e4\uc5b4\uac00\ubcf4\uba74 DB\uc758 \uc5b4\ub290 \ud55c \ud14c\uc774\ube14\uc5d0 \ub0b4\uc6a9\ubb3c\uc774 \uace0\uc2a4\ub780\ud788 \uc788\uc74c\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. (\uc554\ud638\ud654\ub294 \uc548\ub418\uc5b4\uc788\uc5c8\uc74c) \ub098\ub294 \ubcf4\ud1b5 \uc11c\ube44\uc2a4\ub9c8\ub2e4 \ubcc4\ub3c4\uc758 MySQL \uacc4\uc815\uacfc \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ub9cc\ub4e4\uc5b4\uc8fc\uace0 \uc811\uc18d\uc740 \ub85c\uceec\uc5d0\uc11c\ub9cc \uac00\ub2a5\ud558\ub3c4\ub85d \uc124\uc815\ud55c\ub2e4. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-db"],"_links":{"self":[{"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":11,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions\/788"}],"wp:attachment":[{"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}