{"id":14,"date":"2020-10-12T10:13:13","date_gmt":"2020-10-12T01:13:13","guid":{"rendered":"https:\/\/centos.ihavenomoney.co.kr\/?page_id=14"},"modified":"2025-12-26T14:05:12","modified_gmt":"2025-12-26T05:05:12","slug":"mysql-%ec%84%a4%ec%b9%98","status":"publish","type":"page","link":"https:\/\/centos.ihavenomoney.co.kr\/?page_id=14","title":{"rendered":"MySql \uc124\uce58"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">MySql&nbsp; \uae30\ubcf8\uc124\uce58<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Remark:<\/h3>\n\n\n\n<p>MySql \uc758 \ucd5c\uc2e0 \ubc84\uc804 version: 8.0.23 \uc744 \uc124\uce58\ud574 \ubcf4\uc790.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1.&nbsp; Download the MySQL repositories<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-3.noarch.rpm<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Install MySQL packages<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3.&nbsp;Install MySQL<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo yum install mysql-server<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. Start MySQL<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo systemctl start mysqld<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. Start MySQL<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo systemctl status mysqld\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo systemctl status mysqld\n\u25cf mysqld.service - MySQL Server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/mysqld.service; enabled; vendor preset: disabled)\n   Active: active (running) since Tue 2021-01-19 11:19:30 KST; 2h 32min ago\n     Docs: man:mysqld(8)\n           http:\/\/dev.mysql.com\/doc\/refman\/en\/using-systemd.html\n  Process: 3137 ExecStartPre=\/usr\/bin\/mysqld_pre_systemd (code=exited, status=0\/SUCCESS)\n Main PID: 3214 (mysqld)\n   Status: \"Server is operational\"\n   CGroup: \/system.slice\/mysqld.service\n           \u2514\u25003214 \/usr\/sbin\/mysqld\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. MySQL Root User temporary root password check<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo grep 'password' \/var\/log\/mysqld.log<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo grep 'password' \/var\/log\/mysqld.log\n2021-01-19T02:18:21.839765Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: &amp;12323232<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6. mysql_secure_installation<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mysql_secure_installation<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h3 class=\"wp-block-heading\">root \uacc4\uc815\uc774 <strong>\ube44\ubc00\ubc88\ud638 \uc778\uc99d\uc774 \uc544\ub2c8\ub77c <code>auth_socket<\/code> \ubc29\uc2dd<\/strong>\uc73c\ub85c \uc124\uc815\ub428<\/h3>\n\n\n\n<p>Ubuntu\uc5d0\uc11c <code>apt install mysql-server<\/code>\ub85c \uc124\uce58\ud558\uba74<br><strong>MySQL root \uacc4\uc815\uc740 \uae30\ubcf8\uc801\uc73c\ub85c \ube44\ubc00\ubc88\ud638 \ub85c\uadf8\uc778\uc744 \ub9c9\uace0<\/strong>,<br>OS\uc758 <code>root<\/code> \uc0ac\uc6a9\uc790\ub9cc \uc811\uc18d \uac00\ub2a5\ud558\ub3c4\ub85d \uc124\uc815\ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc989,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u274c <code>mysql -u root -p<\/code> \u2192 \uc2e4\ud328<\/li>\n\n\n\n<li>\u2705 <code>sudo mysql<\/code> \u2192 \uc131\uacf5<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">localhost@localhost:~$ sudo mysql_secure_installation\n\nSecuring the MySQL server deployment.\n\nConnecting to MySQL using a blank password.\n\nVALIDATE PASSWORD COMPONENT can be used to test passwords\nand improve security. It checks the strength of password\nand allows the users to set only those passwords which are\nsecure enough. Would you like to setup VALIDATE PASSWORD component?\n\nPress y|Y for Yes, any other key for No: y\n\nThere are three levels of password validation policy:\n\nLOW    Length &gt;= 8\nMEDIUM Length &gt;= 8, numeric, mixed case, and special characters\nSTRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary file\n\nPlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0\n\nSkipping password set for root as authentication with auth_socket is used by default.\nIf you would like to use password authentication instead, this can be done with the \"ALTER_USER\" command.\nSee https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/alter-user.html#alter-user-password-management for more information.\n\nBy default, a MySQL installation has an anonymous user,\nallowing anyone to log into MySQL without having to have\na user account created for them. This is intended only for\ntesting, and to make the installation go a bit smoother.\nYou should remove them before moving into a production\nenvironment.\n\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : n\n\n ... skipping.\n\n\nNormally, root should only be allowed to connect from\n'localhost'. This ensures that someone cannot guess at\nthe root password from the network.\n\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : No\n\n ... skipping.\nBy default, MySQL comes with a database named 'test' that\nanyone can access. This is also intended only for testing,\nand should be removed before moving into a production\nenvironment.\n\n\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : y\n - Dropping test database...\nSuccess.\n\n - Removing privileges on test database...\nSuccess.\n\nReloading the privilege tables will ensure that all changes\nmade so far will take effect immediately.\n\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : y\nSuccess.\n\nAll done!\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7.&nbsp; Root remote allow authority (root&nbsp; % )<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">localhost@localhost:~$ sudo mysql\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 19\nServer version: 8.4.7-0localhost0.25.10.3 (localhost)\n\nCopyright (c) 2000, 2025, 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; use mysql\nReading table information for completion of table and column names\nYou can turn off this feature to get a quicker startup with -A\n\nDatabase changed\nmysql&gt; SELECT user, host, plugin\n    -&gt; FROM mysql.user\n    -&gt; WHERE user = 'root';\n+------+-----------+-------------+\n| user | host      | plugin      |\n+------+-----------+-------------+\n| root | localhost | auth_socket |\n+------+-----------+-------------+\n1 row in set (0.00 sec)<\/pre><\/div>\n\n\n\n<p>plugin \uac12\uc774  auth_socket \ub418\uc5b4 \uc788\uace0,<br>IP \ub85c \uc138\ud305\ud558\uba74 host mysql \ub85c\uadf8\uc778\uc774 \ub418\uc9c0 \uc54a\uc74c<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udfe2 \ubc29\ubc95 1\ufe0f\u20e3 (\uac00\uc7a5 \uad8c\uc7a5) : <code>sudo mysql<\/code> \uc0ac\uc6a9<\/h2>\n\n\n\n<p>\ubcf4\uc548\uc801\uc73c\ub85c <strong>\uac00\uc7a5 \uc548\uc804\ud55c \uae30\ubcf8 \ubc29\uc2dd<\/strong>\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\uc11c\ubc84 \uc6b4\uc601 \ud658\uacbd\uc5d0\uc11c\ub294 \uc774 \ubc29\ubc95\uc744 \uadf8\ub300\ub85c \uc4f0\ub294 \uac8c \uc77c\ubc18\uc801\uc785\ub2c8\ub2e4.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udfe1 \ubc29\ubc95 2\ufe0f\u20e3 : root \uacc4\uc815\uc744 <strong>\ube44\ubc00\ubc88\ud638 \ub85c\uadf8\uc778 \uac00\ub2a5\ud558\uac8c \ubcc0\uacbd<\/strong><\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\ub85c\uceec \uac1c\ubc1c\ud658\uacbd\uc5d0\uc11c \ud3b8\ud560 \ub54c \uc0ac\uc6a9<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u2460 MySQL \uc811\uc18d<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u2461 \uc778\uc99d \ubc29\uc2dd \ubcc0\uacbd + \ube44\ubc00\ubc88\ud638 \uc124\uc815<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER USER 'root'@'localhost'\nIDENTIFIED WITH mysql_native_password\nBY '\uc0c8\ube44\ubc00\ubc88\ud638';\n\nFLUSH PRIVILEGES;\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h4 class=\"wp-block-heading\">\uc5d0\ub7ec\uc2dc -&gt; mysql_native_password \uc548\ub41c\uc0c1\ud0dc,  \uae30\uc874 caching_sha2_password \uc0ac\uc6a9<\/h4>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded<\/pre><\/div>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">mysql&gt;ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY '\ube44\ubc00\ubc88\ud638';<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u2462 \uc811\uc18d \ud14c\uc2a4\ud2b8<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd34 \ubc29\ubc95 3\ufe0f\u20e3 : root \ub300\uc2e0 <strong>\ubcc4\ub3c4 \uad00\ub9ac\uc790 \uacc4\uc815 \uc0dd\uc131 (\ucd94\ucc9c)<\/strong><\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\uc6b4\uc601 \ud658\uacbd\uc5d0\uc11c\ub294 <strong>\uc774 \ubc29\ubc95\uc774 \ubca0\uc2a4\ud2b8<\/strong><\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE USER 'admin'@'localhost'\nIDENTIFIED BY '\ube44\ubc00\ubc88\ud638';\n\nGRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'\nWITH GRANT OPTION;\n\nFLUSH PRIVILEGES;\n<\/code><\/pre>\n\n\n\n<p>\uc811\uc18d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u admin -p<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">8.&nbsp; Remote allow configuration (<code>bind-address<\/code>&nbsp;)<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" ># sudo vi \/etc\/mysql\/mysql.conf.d\/mysql.cnf<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" ># \uc8fc\uc11d\ucc98\ub9ac\n\n#bind-address           = 127.0.0.1\n#mysqlx-bind-address    = 127.0.0.1\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9.\u00a0 \ubc29\ud654\ubcbd \uc624\ud508 \ubc0f Mysql Restart<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" ># sudo systemctl restart mysql\n\n# sudo ufw allow mysql\n<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">10.&nbsp; MySQL Workbench Connect&nbsp; test<br>\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-148\" src=\"https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/Mysql_bench.jpg\" alt=\"\" width=\"416\" height=\"222\" srcset=\"https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/Mysql_bench.jpg 416w, https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/Mysql_bench-300x160.jpg 300w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><\/figure><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>MySql&nbsp; \uae30\ubcf8\uc124\uce58 Remark: MySql \uc758 \ucd5c\uc2e0 \ubc84\uc804 version: 8.0.23 \uc744 \uc124\uce58\ud574 \ubcf4\uc790. 1.&nbsp; Download the MySQL repositories # sudo wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-3.noarch.rpm 2. Install MySQL packages # sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm 3.&nbsp;Install MySQL # sudo yum install mysql-server 4. Start MySQL # sudo systemctl start mysqld 5. Start MySQL # sudo systemctl status mysqld # sudo &hellip;<br \/><a href=\"https:\/\/centos.ihavenomoney.co.kr\/?page_id=14\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\"><span class=\"screen-reader-text\">MySql \uc124\uce58<\/span> \ub354\ubcf4\uae30<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-14","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14"}],"version-history":[{"count":16,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/14\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/14\/revisions\/657"}],"wp:attachment":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}