{"id":766,"date":"2021-04-02T12:07:26","date_gmt":"2021-04-02T03:07:26","guid":{"rendered":"https:\/\/hyandmj.asuscomm.com\/hblog\/?p=766"},"modified":"2021-04-02T12:46:29","modified_gmt":"2021-04-02T03:46:29","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-v-8-0","status":"publish","type":"post","link":"https:\/\/hyandmj.asuscomm.com\/hblog\/?p=766","title":{"rendered":"MySQL \uacc4\uc815 \uc0dd\uc131 \uad00\ub9ac \ubc0f \uad8c\ud55c \uc124\uc815 (V 8.0)"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Motive<\/h3>\n\n\n\n<p>\ub0b4\uac00 \uc0ac\uc6a9\ud558\ub294 \ub300\ubd80\ubd84\uc758 \uba38\uc2e0\uc774 \uc6b0\ubd84\ud22c \ubc84\uc804 18\uc5d0\uc11c 20\uc73c\ub85c \ub118\uc5b4\uc654\ub2e4. \uadf8\ub7f0\ub370 MySQL\uc758 \ubc84\uc804\uc774 \uc6b0\ubd84\ud22c \ubc84\uc804\uc774 \uc62c\ub77c\uac10\uc5d0 \ub530\ub77c \uac19\uc774 \uc62c\ub77c\uc640\uc11c <a href=\"https:\/\/hyandmj.asuscomm.com\/hblog\/?p=12\">\uae30\uc874 \uae00\uc758 \ub0b4\uc6a9<\/a>\uc774 \ucd5c\uc2e0 \ubc84\uc804\uacfc \ub2ec\ub77c\uc84c\ub2e4. Ubuntu 20.04\uc5d0\uc11c\ub294 \ud328\ud0a4\uc9c0 \ub9e4\ub2c8\uc800 \uc0c1\uc758 MySQL \ubc84\uc804\uc774 8.0\uc774\ub2e4. 8.0\uc744 \uae30\uc900\uc73c\ub85c \ub2e4\uc2dc \ub178\ud2b8\ub97c \uc801\uc5b4\ubd04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Environment<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Node: Odroid-N2 4GB<\/li><li>OS: Ubuntu 20.042 LTS (GNU\/Linux 4.9.241-113 aarch64)<\/li><li>MySQL Version: 8.0.23-0ubuntu0.20.04.1 for Linux on aarch64 (Ubuntu)<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Installation<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo apt install mysql mysql-client\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\uc811\uc18d<\/h3>\n\n\n\n<p>\uae30\uc5b5\ud560 \uac83\uc740, \uc61b\ub0a0\uc5d4 \ucc98\uc74c \uc124\uce58\ud560 \ub54c root \ud328\uc2a4\uc6cc\ub4dc \uc124\uc815\uc744 \ud588\ub358 \uac83 \uac19\uc740\ub370 \uc774\uc81c\ub294 \uadf8\ub0e5 \uc124\uce58\uac00 \ub05d\ub0ac\ub2e4. \ub2e8\uc21c\ud788 root \uacc4\uc815\uc73c\ub85c \uc811\uc18d\uc744 \uc2dc\ub3c4\ud558\uba74<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ mysql -u root\nERROR 1698 (28000): Access denied for user 'root'@'localhost'\n<\/pre><\/div>\n\n\n<p>\ub77c\ub294 \uc5d0\ub7ec \uba54\uc138\uc9c0\uc640 \ud568\uaed8 \uc811\uc18d\uc774 \uc548\ub418\uace0, \ud639\uc740<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ mysql -u root -p\nEnter password:\nERROR 1698 (28000): Access denied for user 'root'@'localhost'\n<\/pre><\/div>\n\n\n<p>\uc640 \uac19\uc774 \ud328\uc2a4\uc6cc\ub4dc\ub97c \uc548\uce58\uace0 \uadf8\ub0e5 \uc5d4\ud130\ub97c \uccd0\ub3c4 \uc811\uc18d\uc774 \uc548\ub41c\ub2e4. \uc774\ub294 \uad6c\uae00\ub9c1\uc744 \ud574\ubcf4\uba74 \uc774 \ubc84\uc804\uc758 &#8220;MySQL root\ub294 \uc778\uc99d \ubc29\uc2dd\uc744 local\uc5d0 \uc788\ub294 Unix Domain socket\uc73c\ub85c \ud558\uae30\ub54c\ubb38\uc5d0 root \uad8c\ud55c\uc774 \uc788\uc5b4\uc57c\ub9cc \uc5f0\uacb0\uc774 \uac00\ub2a5\ud558&#8221;\uae30 \ub54c\ubb38\uc774\ub77c\uace0 \ud568. \ubb3c\ub860<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo mysql\n<\/pre><\/div>\n\n\n<p>\uc744 \uce58\uba74 (\ub530\ub85c \ube44\ubc00\ubc88\ud638 \uc785\ub825 \uc5c6\uc774\ub3c4) \ubb38\uc81c \uc5c6\uc774 root \uacc4\uc815\uc73c\ub85c \ub85c\uadf8\uc778\uc774 \ub41c\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">root Password \uc124\uc815<\/h3>\n\n\n\n<p>\uae30\uc874\uc758 \ubc29\uc2dd \ub300\ub85c \uc778\uc99d\uc744 \ud558\uace0 \uc2f6\ub2e4\uba74 \uc124\uc815\uc744 \ubc14\uafb8\uc5b4 \uc8fc\uc5b4\uc57c \ud55c\ub2e4. \uc6b0\uc120 <code>sudo mysql<\/code>\uc744 \ud558\uba74<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo mysql\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 8\nServer version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu)\n\nCopyright (c) 2000, 2021, Oracle and\/or its affiliates.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql&gt;\n<\/pre><\/div>\n\n\n<p>\ub85c \uc11c\ubc84 \uc811\uc18d\uc774 \ub41c\ub2e4. \uc774\uc81c \ub9c9 \uc124\uce58\ub97c \ud588\uc73c\ubbc0\ub85c \ubcc4\ub2e4\ub978 DB\ub294 \uc544\uc9c1 \uc5c6\ub2e4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; show databases;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| sys                |\n+--------------------+\n4 rows in set (0.01 sec)\n<\/pre><\/div>\n\n\n<p>\uc544\ub798 \uba85\ub839\uc5b4\ub85c \uc778\uc99d \ubaa8\ub4dc\ub97c \ud655\uc778\ud558\uba74,<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; SELECT user,plugin,host FROM mysql.user;\n+------------------+-----------------------+-----------+\n| user             | plugin                | host      |\n+------------------+-----------------------+-----------+\n| debian-sys-maint | caching_sha2_password | localhost |\n| mysql.infoschema | caching_sha2_password | localhost |\n| mysql.session    | caching_sha2_password | localhost |\n| mysql.sys        | caching_sha2_password | localhost |\n| root             | auth_socket           | localhost |\n+------------------+-----------------------+-----------+\n5 rows in set (0.00 sec)\n<\/pre><\/div>\n\n\n<p>root \uacc4\uc815\uc740 \ube44\ubc00\ubc88\ud638 \uc778\uc99d\uc774 \uc544\ub2c8\ub77c socket \uc778\uc99d \ubc29\uc2dd\uc744 \uc4f0\uace0 \uc788\uc74c\uc744 \uc54c \uc218 \uc788\ub2e4. \ube44\ubc00\ubc88\ud638 \uc778\uc99d \ubaa8\ub4dc\ub85c \ubcc0\uacbd\uc740<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '\ube44\ubc00~';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; flush privileges;\nQuery OK, 0 rows affected (0.00 sec)\n<\/pre><\/div>\n\n\n<p>\ub85c \ud55c\ub2e4. &#8216;\ube44\ubc00~&#8217; \uc790\ub9ac\uc5d0 \uc6d0\ud558\ub294 \ube44\ubc00\ubc88\ud638\ub97c \uc791\uc131\ud55c\ub2e4. \uc774\uc81c \ub2e4\uc2dc \uc778\uc99d \ubaa8\ub4dc\ub97c \ud655\uc778\ud558\uba74,<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; SELECT user,plugin,host FROM mysql.user;\n+------------------+-----------------------+-----------+\n| user             | plugin                | host      |\n+------------------+-----------------------+-----------+\n| debian-sys-maint | caching_sha2_password | localhost |\n| mysql.infoschema | caching_sha2_password | localhost |\n| mysql.session    | caching_sha2_password | localhost |\n| mysql.sys        | caching_sha2_password | localhost |\n| root             | mysql_native_password | localhost |\n+------------------+-----------------------+-----------+\n5 rows in set (0.00 sec)\n<\/pre><\/div>\n\n\n<p>\uc640 \uac19\uc774 \ube44\ubc00\ubc88\ud638 \ubc29\uc2dd\uc73c\ub85c \ubc14\ub010 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4. \uc774\ud6c4\uc758 root \uacc4\uc815 \ub85c\uadf8\uc778\uc740<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ mysql -u root -p\n<\/pre><\/div>\n\n\n<p>\ub85c \uac00\ub2a5\ud558\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uad00\ub9ac\uc790 \uacc4\uc815 \uc0dd\uc131<\/h3>\n\n\n\n<p>root\ub294 \uc2dc\uc2a4\ud15c \uad00\ub9ac\uc790\uac00 \ubcf5\uc218\uc778 \uacbd\uc6b0 \uacf5\uc6a9\uc73c\ub85c \uc4f0\ub294 \ub290\ub08c\uc774 \uac15\ud558\uace0, \ub098\ub294 \ub098\ub9cc\uc758 \uac15\ub825\ud55c \uad00\ub9ac\uc790 \uacc4\uc815\uc744 \ub9cc\ub4e4\uae30 \uc6d0\ud55c\ub2e4. \uc6b0\uc120 \uacc4\uc815\uc740<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; create user 'myAccount'@'%' identified by 'myPasswd';\nQuery OK, 0 rows affected (0.00 sec)\n<\/pre><\/div>\n\n\n<p>\ub85c \ub9cc\ub4e4 \uc218 \uc788\ub2e4. myAccount\ub77c\ub294 \uc774\ub984\uc758 \uacc4\uc815\uc744 \uc0dd\uc131\ud558\ub294 \ub370, \uc5b4\ub514\uc11c\ub4e0 \uc811\uc18d\uc774 \uac00\ub2a5\ud558\uace0, (&#8216;%&#8217;) \ube44\ubc00\ubc88\ud638\ub294 myPasswd\uc774\ub2e4. \ub9cc\ub4e4\uc5b4\uc9c4 \uacc4\uc815\uc740 \uc55e\uc5d0\uc11c\uc640 \uac19\uc740 \ubc29\uc2dd\uc778<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; SELECT user,plugin,host FROM mysql.user;\n+------------------+-----------------------+-----------+\n| user             | plugin                | host      |\n+------------------+-----------------------+-----------+\n| myAccount        | caching_sha2_password | %         |\n| debian-sys-maint | caching_sha2_password | localhost |\n| mysql.infoschema | caching_sha2_password | localhost |\n| mysql.session    | caching_sha2_password | localhost |\n| mysql.sys        | caching_sha2_password | localhost |\n| root             | mysql_native_password | localhost |\n+------------------+-----------------------+-----------+\n6 rows in set (0.00 sec)\n<\/pre><\/div>\n\n\n<p>\uc73c\ub85c \ud655\uc778 \uac00\ub2a5\ud558\ub2e4. \uc774\uc81c \ubaa8\ub4e0 \uad8c\ud55c\uc744 \ub0b4 \uacc4\uc815\uc5d0 \ubd80\uc5ec\ud55c\ub2e4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; grant all privileges on *.* to 'myAccount'@'%';\nQuery OK, 0 rows affected (0.01 sec)\n<\/pre><\/div>\n\n\n<p>\ub0b4 \uacc4\uc815\uc740 \ubb34\uc801\uc774 \ub418\uc5c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uc77c\ubc18 \uacc4\uc815 \uc0dd\uc131<\/h3>\n\n\n\n<p>\ud2b9\uc815 DB \uc785\ucd9c\ub825\uc6a9 \uc77c\ubc18 \uacc4\uc815\ub3c4 \ud558\ub098 \ub9cc\ub4e4\uc5b4 \ubcf4\uc790. \ubc29\uc2dd\uc740 \uc55e\uacfc \uc720\uc0ac\ud558\ub418 \uad8c\ud55c\ub9cc \uc81c\ud55c\ud558\uba74 \ub41c\ub2e4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; create user 'abcd'@'localhost' identified by 'efgh';\nQuery OK, 0 rows affected (0.01 sec)\n<\/pre><\/div>\n\n\n<p>\uc774 \uacc4\uc815\uc740 \ub85c\uceec\uc5d0\uc11c\ub9cc \uc4f0\uc77c \uac83\uc774\ub77c \ud638\uc2a4\ud2b8\ub294 localhost\ub85c \uc81c\ud55c\ud55c\ub2e4. \uc774\uc81c DB\ub97c \ud558\ub098 \ub9cc\ub4e4\uc5b4 \uc8fc\uace0,<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; create database abcd_db;\nQuery OK, 1 row affected (0.01 sec)\n<\/pre><\/div>\n\n\n<p>\uacc4\uc815 abcd\uc5d0\uac8c \uc774 DB\uc758 \uad8c\ud55c\ub9cc \ubd80\uc5ec\ud55c\ub2e4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; grant all privileges on adcd_db.* to 'abcd'@'localhost';\nQuery OK, 0 rows affected (0.00 sec)\n<\/pre><\/div>\n\n\n<p>\uc774 \uacc4\uc815\uc758 \uad8c\ud55c\uc740<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nmysql&gt; show grants for 'abcd'@'localhost';\n+-----------------------------------------------------------+\n| Grants for abcd@localhost                                 |\n+-----------------------------------------------------------+\n| GRANT USAGE ON *.* TO `abcd`@`localhost`                  |\n| GRANT ALL PRIVILEGES ON `abcd_db`.* TO `abcd`@`localhost` |\n+-----------------------------------------------------------+\n2 rows in set (0.00 sec)\n<\/pre><\/div>\n\n\n<p>\ub85c \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Motive \ub0b4\uac00 \uc0ac\uc6a9\ud558\ub294 \ub300\ubd80\ubd84\uc758 \uba38\uc2e0\uc774 \uc6b0\ubd84\ud22c \ubc84\uc804 18\uc5d0\uc11c 20\uc73c\ub85c \ub118\uc5b4\uc654\ub2e4. \uadf8\ub7f0\ub370 MySQL\uc758 \ubc84\uc804\uc774 \uc6b0\ubd84\ud22c \ubc84\uc804\uc774 \uc62c\ub77c\uac10\uc5d0 \ub530\ub77c \uac19\uc774 \uc62c\ub77c\uc640\uc11c \uae30\uc874 \uae00\uc758 \ub0b4\uc6a9\uc774 \ucd5c\uc2e0 \ubc84\uc804\uacfc \ub2ec\ub77c\uc84c\ub2e4. Ubuntu 20.04\uc5d0\uc11c\ub294 \ud328\ud0a4\uc9c0 \ub9e4\ub2c8\uc800 \uc0c1\uc758 MySQL \ubc84\uc804\uc774 8.0\uc774\ub2e4. 8.0\uc744 \uae30\uc900\uc73c\ub85c \ub2e4\uc2dc \ub178\ud2b8\ub97c \uc801\uc5b4\ubd04. Environment Node: Odroid-N2 4GB OS: Ubuntu 20.042 LTS (GNU\/Linux 4.9.241-113 aarch64) MySQL [&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-766","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\/766","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=766"}],"version-history":[{"count":10,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/posts\/766\/revisions"}],"predecessor-version":[{"id":780,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=\/wp\/v2\/posts\/766\/revisions\/780"}],"wp:attachment":[{"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hyandmj.asuscomm.com\/hblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}