{"id":4962,"date":"2021-11-02T12:36:43","date_gmt":"2021-11-02T03:36:43","guid":{"rendered":"\/blog\/?p=4962"},"modified":"2023-09-21T09:26:28","modified_gmt":"2023-09-21T00:26:28","slug":"mysql-5-6-vs-5-7-vs-8-0-%eb%b2%84%ec%a0%84%eb%b3%84-%ec%b0%a8%ec%9d%b4","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=4962","title":{"rendered":"[MySQL] 5.6 vs 5.7 vs 8.0 \ubc84\uc804\ubcc4 \ucc28\uc774"},"content":{"rendered":"\n<span style=\"font-family: monospace; font-size: 12px;\">\uc8fc\uc694\uc815\ubcf4\ud1b5\uc2e0\uae30\ubc18\uc2dc\uc124 \uae30\uc220\uc801 \ucde8\uc57d\uc810 \ubd84\uc11d \ud3c9\uac00 \uc0c1\uc138 \uac00\uc774\ub4dc\uc758 \ub370\uc774\ud130\ubca0\uc774\uc2a4(MySQL) \ubd80\ubd84\uc744 \ubcf4\uba74 \uad6c \ubc84\uc804\uacfc \ucd5c\uc2e0 \ubc84\uc804\uc758 \uc124\uc815 \uac12 \ucc28\uc774\uac00 \ubc18\uc601\ub418\uc5b4 \uc788\uc9c0 \uc54a\ub294\ub2e4.<br \/><br \/>\uae30\ubc18\uc2dc\uc124 \uae30\uc900\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \ub193\uc740 \ucde8\uc57d\uc810 \uc9c4\ub2e8 \uc2a4\ud06c\ub9bd\ud2b8\ub85c MySQL\uc744 \uc9c4\ub2e8\ud558\uba74 \uc124\uc815 \uac12\uc744 \ud655\uc778\ud560 \uc218 \uc5c6\ub2e4\ub294 \uc5d0\ub7ec \uba54\uc2dc\uc9c0\uac00 \ucd9c\ub825\ub41c\ub2e4.<br \/><br \/>\uc774\ub294 \uc77c\ubd80 \ud56d\ubaa9\uc774 \ubc84\uc804\ubcc4 \ucc28\uc774\uc810\uc774 \uc874\uc7ac\ud574\uc11c \ucd9c\ub825\ub418\ub294\ub370, \ub808\ud37c\ub7f0\uc2a4 \uba54\ub274\uc5bc\uc744 \ucc38\uace0\ud558\uc5ec \ucde8\uc57d\uc810 \uc9c4\ub2e8 \ubc0f \ubcf4\uc548 \uc870\uce58\ub97c \ud558\ub294 \ubc29\ubc95\uc744 \uc124\uba85\ud55c\ub2e4.<br \/><br \/>MySQL Reference Manual<br \/><br \/><strong>\u25a0 root \uacc4\uc815\uc758 \ud328\uc2a4\uc6cc\ub4dc \ubcc0\uacbd<\/strong><br \/>root \uacc4\uc815\uc758 \ud328\uc2a4\uc6cc\ub4dc\uac00 \uc124\uc815\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc744 \uacbd\uc6b0 \uc784\uc758\uc758 \uc0ac\uc6a9\uc790\uac00 root \uad8c\ud55c\uc73c\ub85c \uc2dc\uc2a4\ud15c\uc5d0 \uc811\uadfc\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc800\uc7a5\ub41c \ubaa8\ub4e0 \uc815\ubcf4\ub97c \uc720\ucd9c \ubc0f \ubcc0\uc870\uac00 \uac00\ub2a5\ud558\uba70 \uc2dc\uc2a4\ud15c\uc758 \uc258\uc744 \uc5bb\uc744 \uac00\ub2a5\uc131\uc774 \uc874\uc7ac\ud55c\ub2e4.<br \/><br \/>\uff20\ucde8\uc57d\uc810 \uc9c4\ub2e8<br \/>5.6 \uc774\ud558<br \/>mysql&gt; select host, user, password from mysql.user where user='root' and password='';<br \/><br \/>5.7 \uc774\uc0c1<br \/>mysql&gt; select user, authentication_string from mysql.user where user='root' and authentication_string='';<br \/><br \/>\uff20\ubcf4\uc548 \uc870\uce58<br \/>5.6 \uc774\ud558<br \/>mysql&gt; update user set password=password('new password') where user='root';<br \/><br \/>5.7 \uc774\uc0c1<br \/>mysql&gt; update user set authentication_string=password('new password') where user='root';<br \/><br \/>8.0 \uc774\uc0c1<br \/>mysql&gt; alter user 'root'@'localhost' identified with mysql_native_password by 'new password';<br \/>mysql&gt; set password for 'root'@'localhost' = password('new password');<br \/><br \/><br \/><br \/><strong>\u25a0 \ud328\uc2a4\uc6cc\ub4dc \ucd5c\ub300\uc0ac\uc6a9\uae30\uac04 \ubc0f \ubcf5\uc7a1\ub3c4 \uc124\uc815<\/strong><br \/>\uc77c\uc815 \uae30\uac04 \ub0b4\uc758 \ud328\uc2a4\uc6cc\ub4dc\ub97c \ubcc0\uacbd\ud558\uc9c0 \uc54a\uac70\ub098 \ubcf5\uc7a1\ub3c4\uac00 \uc124\uc815\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc73c\uba74 \uacf5\uaca9\uc790\ub294 \ubb34\uc791\uc704 \ub300\uc785 \uacf5\uaca9\uc744 \uc2dc\ub3c4\ud558\uc5ec \ud328\uc2a4\uc6cc\ub4dc\ub97c \ud68d\ub4dd\ud560 \uc218 \uc788\ub2e4.<br \/><br \/>\uff20\ucde8\uc57d\uc810 \uc9c4\ub2e8<br \/>5.7 \uc774\uc0c1 (\ucd5c\ub300\uc0ac\uc6a9\uae30\uac04)<br \/>\ucde8\uc57d : 0 \ub610\ub294 NULL (\ubb34\uc81c\ud55c)<br \/>mysql&gt; select user, password_lifetime, password_last_changed from mysql.user<br \/>mysql&gt; show variables like 'default_password_lifetime';<br \/># cat \/etc\/my.cnf | grep default_password_lifetime<br \/><br \/>5.7 \uc774\uc0c1 (\ubcf5\uc7a1\ub3c4)<br \/>\ucde8\uc57d : 0 \ub610\ub294 LOW (\ud328\uc2a4\uc6cc\ub4dc \uae38\uc774 \uac80\uc99d)<br \/>mysql&gt; show variables like 'validate_password_policy';<br \/># cat \/etc\/my.cnf | grep validate_password_policy<br \/><br \/>\uff20\ubcf4\uc548 \uc870\uce58<br \/>5.7 \uc774\uc0c1 (\ucd5c\ub300\uc0ac\uc6a9\uae30\uac04)<br \/>mysql&gt; set global default_password_lifetime=90;<br \/><br \/>5.7 \uc774\uc0c1 (\ubcf5\uc7a1\ub3c4)<br \/>mysql&gt; set global validate_password_policy=1;<br \/><br \/><br \/><br \/><strong>\u25a0 \ud328\uc2a4\uc6cc\ub4dc \uc7ac\uc0ac\uc6a9 \uc81c\ud55c<\/strong><br \/>\ud328\uc2a4\uc6cc\ub4dc\ub97c \ubcc0\uacbd \uc2dc \uc774\uc804\uc5d0 \uc0ac\uc6a9\ud55c \ud328\uc2a4\uc6cc\ub4dc\ub97c \ub3d9\uc77c\ud558\uac8c \uc124\uc815\ud574\uc11c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0 \uc720\ucd9c\ub2f9\ud55c \ud328\uc2a4\uc6cc\ub4dc\ub97c \ubcc0\uacbd\ud558\uc9c0 \uc54a\uc740 \ud55c \uacc4\uc18d \uc0ac\uc6a9\ud560 \uc704\ud5d8\uc774 \uc874\uc7ac\ud55c\ub2e4.<br \/><br \/>\uff20\ucde8\uc57d\uc810 \uc9c4\ub2e8<br \/>8.0 \uc774\uc0c1 (\ud328\uc2a4\uc6cc\ub4dc \uc7ac\uc0ac\uc6a9 \uae30\uac04)<br \/>mysql&gt; show variables like 'password_reuse_interval';<br \/><br \/>8.0 \uc774\uc0c1 (\ud328\uc2a4\uc6cc\ub4dc \uac1c\uc218)<br \/>mysql&gt; show variables like 'password_history';<br \/><br \/>\uff20\ubcf4\uc548 \uc870\uce58<br \/>8.0 \uc774\uc0c1 (\ud328\uc2a4\uc6cc\ub4dc \uc7ac\uc0ac\uc6a9 \uae30\uac04)<br \/>mysql&gt; set global password_reuse_interval=90;<br \/><br \/>8.0 \uc774\uc0c1 (\ud328\uc2a4\uc6cc\ub4dc \uac1c\uc218)<br \/>mysql&gt; set global password_history=6;<br \/><br \/><br \/><br \/><strong>\u25a0 \ub85c\uadf8\uc778 \uc2dc\ub3c4 \ud69f\uc218 \uc81c\ud55c<\/strong><br \/>\uc77c\uc815 \ud69f\uc218 \uc774\uc0c1 \ub85c\uadf8\uc778 \uc2e4\ud328(\uacc4\uc815 \uc7a0\uae08 \uc784\uacc4\uac12)\ub97c \uc81c\ud55c\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0 \ubb34\uc791\uc704 \ub300\uc785 \uacf5\uaca9, \ud328\uc2a4\uc6cc\ub4dc \ucd94\uce21 \uacf5\uaca9\uc744 \uc9c0\uc18d\uc801\uc73c\ub85c \uc2dc\ub3c4\ud560 \uac00\ub2a5\uc131\uc774 \uc874\uc7ac\ud55c\ub2e4.<br \/><br \/>\uff20\ucde8\uc57d\uc810 \uc9c4\ub2e8<br \/>8.0.19 \uc774\uc0c1<br \/>mysql&gt; select user, failed_login_attempts from mysql.user;<br \/><br \/>\uff20\ubcf4\uc548 \uc870\uce58<br \/>8.0.19 \uc774\uc0c1<br \/>mysql&gt; alter user 'dazemonkey'@'localhost' failed_login_attempts 5;<br \/><br \/><br \/><br \/><strong>\u25a0 \ud328\uc2a4\uc6cc\ub4dc \uac80\uc99d \ud568\uc218 \uc0ac\uc6a9<\/strong><br \/>validate_password.so \ud50c\ub7ec\uadf8\uc778\uc774 \ud65c\uc131\ud654\uac00 \ub418\uc5b4 \uc788\uc73c\uba74 \ud328\uc2a4\uc6cc\ub4dc \uac80\uc99d \uaddc\uce59\uc744 \uac15\ud558\uac8c \uc124\uc815\ud560 \uc218 \uc788\ub2e4.<br \/><br \/>\uff20\ucde8\uc57d\uc810 \uc9c4\ub2e8<br \/>5.7 \uc774\uc0c1<br \/>mysql&gt; show variables like 'validate_password_%';<br \/><br \/>\uff20\ubcf4\uc548 \uc870\uce58<br \/>5.7 \uc774\uc0c1<br \/>mysql&gt; install plugin validate_password soname 'validate_password.so';<br \/># vi \/etc\/my.cnf<br \/>plugin-load &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = validate_password.so<br \/>validate-password &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = FORCE_PLUS_PERMANENT<br \/>validate-password-policy &nbsp; &nbsp; &nbsp; &nbsp;= MEDIUM<br \/>validate-password-mixed-case-count = 0<br \/><br \/>\ucd9c\ucc98: <a href=\"https:\/\/dazemonkey.tistory.com\/101\" target=\"_blank\" rel=\"noopener\">https:\/\/dazemonkey.tistory.com\/101<\/a><\/span>\n","protected":false},"excerpt":{"rendered":"<p>\uc8fc\uc694\uc815\ubcf4\ud1b5\uc2e0\uae30\ubc18\uc2dc\uc124 \uae30\uc220\uc801 \ucde8\uc57d\uc810 \ubd84\uc11d \ud3c9\uac00 \uc0c1\uc138 \uac00\uc774\ub4dc\uc758 \ub370\uc774\ud130\ubca0\uc774\uc2a4(MySQL) \ubd80\ubd84\uc744 \ubcf4\uba74 \uad6c \ubc84\uc804\uacfc \ucd5c\uc2e0 \ubc84\uc804\uc758 \uc124\uc815 \uac12 \ucc28\uc774\uac00 \ubc18\uc601\ub418\uc5b4 \uc788\uc9c0 \uc54a\ub294\ub2e4. \uae30\ubc18\uc2dc\uc124 \uae30\uc900\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \ub193\uc740 \ucde8\uc57d\uc810 \uc9c4\ub2e8 \uc2a4\ud06c\ub9bd\ud2b8\ub85c MySQL\uc744 \uc9c4\ub2e8\ud558\uba74 \uc124\uc815 \uac12\uc744 \ud655\uc778\ud560 \uc218 \uc5c6\ub2e4\ub294 \uc5d0\ub7ec \uba54\uc2dc\uc9c0\uac00 \ucd9c\ub825\ub41c\ub2e4. \uc774\ub294 \uc77c\ubd80 \ud56d\ubaa9\uc774 \ubc84\uc804\ubcc4 \ucc28\uc774\uc810\uc774 \uc874\uc7ac\ud574\uc11c \ucd9c\ub825\ub418\ub294\ub370, \ub808\ud37c\ub7f0\uc2a4 \uba54\ub274\uc5bc\uc744 \ucc38\uace0\ud558\uc5ec \ucde8\uc57d\uc810 \uc9c4\ub2e8 \ubc0f \ubcf4\uc548 \uc870\uce58\ub97c \ud558\ub294 \ubc29\ubc95\uc744 \uc124\uba85\ud55c\ub2e4. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[10],"tags":[],"class_list":["post-4962","post","type-post","status-publish","format-standard","hentry","category-computing_database"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4962"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4962\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}